60 lines
30 KiB
HTML
60 lines
30 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-US" dir="ltr">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>Configuration | clice</title>
|
||
<meta name="description" content="a powerful and modern C++ language server">
|
||
<meta name="generator" content="VitePress v1.6.3">
|
||
<link rel="preload stylesheet" href="/assets/style.B6tXkhGK.css" as="style">
|
||
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
||
|
||
<script type="module" src="/assets/app.DwF6IAiX.js"></script>
|
||
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
||
<link rel="modulepreload" href="/assets/chunks/theme.Bcb8IYOc.js">
|
||
<link rel="modulepreload" href="/assets/chunks/framework.U1Gow_7P.js">
|
||
<link rel="modulepreload" href="/assets/configuration.md.CpRedDOQ.lean.js">
|
||
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
||
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
||
</head>
|
||
<body>
|
||
<div id="app"><div class="Layout" data-v-d8b57b2d><!--[--><!--]--><!--[--><span tabindex="-1" data-v-fcbfc0e0></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-fcbfc0e0>Skip to content</a><!--]--><!----><header class="VPNav" data-v-d8b57b2d data-v-7ad780c2><div class="VPNavBar" data-v-7ad780c2 data-v-9fd4d1dd><div class="wrapper" data-v-9fd4d1dd><div class="container" data-v-9fd4d1dd><div class="title" data-v-9fd4d1dd><div class="VPNavBarTitle has-sidebar" data-v-9fd4d1dd data-v-9f43907a><a class="title" href="/" data-v-9f43907a><!--[--><!--]--><!----><span data-v-9f43907a>clice</span><!--[--><!--]--></a></div></div><div class="content" data-v-9fd4d1dd><div class="content-body" data-v-9fd4d1dd><!--[--><!--]--><div class="VPNavBarSearch search" data-v-9fd4d1dd><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-9fd4d1dd data-v-afb2845e><span id="main-nav-aria-label" class="visually-hidden" data-v-afb2845e> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-afb2845e data-v-815115f5><!--[--><span data-v-815115f5>Home</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/markdown-examples.html" tabindex="0" data-v-afb2845e data-v-815115f5><!--[--><span data-v-815115f5>Examples</span><!--]--></a><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-9fd4d1dd data-v-acee064b data-v-bfe7971f><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-bfe7971f><span class="text" data-v-bfe7971f><span class="vpi-languages option-icon" data-v-bfe7971f></span><!----><span class="vpi-chevron-down text-icon" data-v-bfe7971f></span></span></button><div class="menu" data-v-bfe7971f><div class="VPMenu" data-v-bfe7971f data-v-20ed86d6><!----><!--[--><!--[--><div class="items" data-v-acee064b><p class="title" data-v-acee064b>English</p><!--[--><div class="VPMenuLink" data-v-acee064b data-v-7eeeb2dc><a class="VPLink link" href="/zh/configuration.html" data-v-7eeeb2dc><!--[--><span data-v-7eeeb2dc>简体中文</span><!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-9fd4d1dd data-v-3f90c1a5><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-3f90c1a5 data-v-be9742d9 data-v-b4ccac88><span class="check" data-v-b4ccac88><span class="icon" data-v-b4ccac88><!--[--><span class="vpi-sun sun" data-v-be9742d9></span><span class="vpi-moon moon" data-v-be9742d9></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-9fd4d1dd data-v-ef6192dc data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://github.com/clice-project/clice" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-60a9a2d3><span class="vpi-social-github"></span></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-9fd4d1dd data-v-f953d92f data-v-bfe7971f><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-bfe7971f><span class="vpi-more-horizontal icon" data-v-bfe7971f></span></button><div class="menu" data-v-bfe7971f><div class="VPMenu" data-v-bfe7971f data-v-20ed86d6><!----><!--[--><!--[--><div class="group translations" data-v-f953d92f><p class="trans-title" data-v-f953d92f>English</p><!--[--><div class="VPMenuLink" data-v-f953d92f data-v-7eeeb2dc><a class="VPLink link" href="/zh/configuration.html" data-v-7eeeb2dc><!--[--><span data-v-7eeeb2dc>简体中文</span><!--]--></a></div><!--]--></div><div class="group" data-v-f953d92f><div class="item appearance" data-v-f953d92f><p class="label" data-v-f953d92f>Appearance</p><div class="appearance-action" data-v-f953d92f><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-f953d92f data-v-be9742d9 data-v-b4ccac88><span class="check" data-v-b4ccac88><span class="icon" data-v-b4ccac88><!--[--><span class="vpi-sun sun" data-v-be9742d9></span><span class="vpi-moon moon" data-v-be9742d9></span><!--]--></span></span></button></div></div></div><div class="group" data-v-f953d92f><div class="item social-links" data-v-f953d92f><div class="VPSocialLinks social-links-list" data-v-f953d92f data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://github.com/clice-project/clice" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-60a9a2d3><span class="vpi-social-github"></span></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-9fd4d1dd data-v-6bee1efd><span class="container" data-v-6bee1efd><span class="top" data-v-6bee1efd></span><span class="middle" data-v-6bee1efd></span><span class="bottom" data-v-6bee1efd></span></span></button></div></div></div></div><div class="divider" data-v-9fd4d1dd><div class="divider-line" data-v-9fd4d1dd></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-d8b57b2d data-v-2488c25a><div class="container" data-v-2488c25a><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-2488c25a><span class="vpi-align-left menu-icon" data-v-2488c25a></span><span class="menu-text" data-v-2488c25a>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-2488c25a data-v-6b867909><button data-v-6b867909>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-d8b57b2d data-v-42c4c606><div class="curtain" data-v-42c4c606></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-42c4c606><span class="visually-hidden" id="sidebar-aria-label" data-v-42c4c606> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-51288d80><section class="VPSidebarItem level-0" data-v-51288d80 data-v-0009425e><div class="item" role="button" tabindex="0" data-v-0009425e><div class="indicator" data-v-0009425e></div><h2 class="text" data-v-0009425e>Guide</h2><!----></div><div class="items" data-v-0009425e><!--[--><div class="VPSidebarItem level-1 is-link" data-v-0009425e data-v-0009425e><div class="item" data-v-0009425e><div class="indicator" data-v-0009425e></div><a class="VPLink link link" href="/guide.html" data-v-0009425e><!--[--><p class="text" data-v-0009425e>Guide</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-0009425e data-v-0009425e><div class="item" data-v-0009425e><div class="indicator" data-v-0009425e></div><a class="VPLink link link" href="/api-examples.html" data-v-0009425e><!--[--><p class="text" data-v-0009425e>Runtime API Examples</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-d8b57b2d data-v-9a6c75ad><div class="VPDoc has-sidebar has-aside" data-v-9a6c75ad data-v-e6f2a212><!--[--><!--]--><div class="container" data-v-e6f2a212><div class="aside" data-v-e6f2a212><div class="aside-curtain" data-v-e6f2a212></div><div class="aside-container" data-v-e6f2a212><div class="aside-content" data-v-e6f2a212><div class="VPDocAside" data-v-e6f2a212 data-v-cb998dce><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-cb998dce data-v-f610f197><div class="content" data-v-f610f197><div class="outline-marker" data-v-f610f197></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-f610f197>On this page</div><ul class="VPDocOutlineItem root" data-v-f610f197 data-v-53c99d69><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-cb998dce></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-e6f2a212><div class="content-container" data-v-e6f2a212><!--[--><!--]--><main class="main" data-v-e6f2a212><div style="position:relative;" class="vp-doc _configuration" data-v-e6f2a212><div><h1 id="configuration" tabindex="-1">Configuration <a class="header-anchor" href="#configuration" aria-label="Permalink to "Configuration""></a></h1><p>This is the document of</p><h2 id="server" tabindex="-1">Server <a class="header-anchor" href="#server" aria-label="Permalink to "Server""></a></h2><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>server.moduleSupport</code></td><td><code>boolean</code></td><td><code>false</code></td></tr></tbody></table><p>Whether to enable module support. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>server.overSearch</code></td><td><code>boolean</code></td><td><code>true</code></td></tr></tbody></table><ul><li><code>false</code>: Limits the symbol search scope to files connected through the <strong>include graph</strong>, which is efficient but does not handle symbols defined independently in other files.</li></ul><p>For example:</p><div class="language-cpp vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">cpp</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/// a.h</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">struct</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {};</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/// b.cpp</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "a.h"</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Foo foo1;</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/// c.cpp</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "a.h"</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Foo foo2;</span></span></code></pre></div><p>If you look up the symbol <code>Foo</code> in <code>b.cpp</code>, the include graph guides the search path as follows: <code>b.cpp</code> -> <code>a.h</code> -> <code>c.cpp</code>. All other files are ignored. When you have a really large project, this can save a lot of time.</p><ul><li><code>true</code>: Expands the search to all index files, ignoring the include graph. This is less efficient but ensures all references to a symbol can be found, even if they are not linked through <code>#include</code>.</li></ul><p>For example, consider the following files:</p><div class="language-cpp vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">cpp</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/// a.cpp </span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">struct</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {};</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Foo foo1;</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/// b.cpp</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">struct</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Foo</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> foo2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>In such case, because the symbol <code>Foo</code> is independently declared in multiple files. To find all references to <code>Foo</code>, it becomes necessary to search all index files. <br></p><h2 id="rule" tabindex="-1">Rule <a class="header-anchor" href="#rule" aria-label="Permalink to "Rule""></a></h2><p><code>[rules]</code> represents that it is an array of objects. Each object has the following properties. Note that the order of rules matters. clice applies the first matching rule to the file. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th></tr></thead><tbody><tr><td><code>[rules].pattern</code></td><td><code>string</code></td></tr></tbody></table><p>Glob pattern for matching files. If the pattern matches the file path, clice will apply the rule to the file.</p><p>Normally, the pattern is a file path. However, you can also use the following syntax to match multiple files:</p><ul><li><code>*</code>: Matches one or more characters in a path segment.</li><li><code>?</code>: Matches a single character in a path segment.</li><li><code>**</code>: Matches any number of path segments, including none.</li><li><code>{}</code>: Groups conditions (e.g., <code>**/*.{ts,js}</code> matches all TypeScript and JavaScript files).</li><li><code>[]</code>: Declares a range of characters to match in a path segment(e.g., <code>example.[0-9]</code> matches <code>example.0</code>, <code>example.1</code>, etc.).</li><li><code>[!...]</code>: Negates a range of characters to match in a path segment(e.g., <code>example.[!0-9]</code> matches <code>example.a</code>, <code>example.b</code>, but not <code>example.0</code>). <br></li></ul><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>[rules].append</code></td><td><code>array</code> of <code>string</code></td><td><code>[]</code></td></tr></tbody></table><p>Commands to append to the original command list. For example, <code>append = ["-std=c++17"]</code>. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>[rules].remove</code></td><td><code>array</code> of <code>string</code></td><td><code>[]</code></td></tr></tbody></table><p>Commands to remove from the original command list. For example, <code>remove = ["-std=c++11"]</code>. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>[rules].readonly</code></td><td><code>string</code></td><td><code>"auto"</code></td></tr></tbody></table><p>Controls whether the file is treated as readonly. Value could be one of <code>"auto"</code>, <code>"always"</code> and <code>"never"</code>.</p><ul><li><code>"auto"</code>: Treats the file as readonly until you edit it.</li><li><code>"always"</code>: Always treats the file as readonly.</li><li><code>"never"</code>: Always treats the file as non-readonly.</li></ul><p>Readonly means the file is not editable, and LSP requests such as code actions or completions will not be triggered on it. This avoids dynamic computation and allows pre-indexed results to be loaded directly, improving performance. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>[rules].header</code></td><td><code>string</code></td><td><code>"auto"</code></td></tr></tbody></table><p>Controls how header files are treated. Value could be one of <code>"auto"</code>, <code>"always"</code> and <code>"never"</code>.</p><ul><li><code>"auto"</code>: Attempts to infer the header context first. If no header context is found, the file will be treated as a normal source file.</li><li><code>"always"</code>: Always treats the file as a header file. If no header context is found, errors will be reported.</li><li><code>"never"</code>: Always treats the file as a source file.</li></ul><p>Header context refers to the related source files or additional metadata linked to the header file. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>[rules].contexts</code></td><td><code>array</code> of <code>string</code></td><td><code>[]</code></td></tr></tbody></table><p>Specifies extra header contexts (file paths) for the file.</p><p>Normally, header contexts are inferred automatically once the file is indexed. However, if you need immediate context before indexing completes, you can provide it manually using this field.</p><h2 id="cache" tabindex="-1">Cache <a class="header-anchor" href="#cache" aria-label="Permalink to "Cache""></a></h2><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>cache.dir</code></td><td><code>string</code></td><td><code>"${workspace}/.clice/cache"</code></td></tr></tbody></table><p>Directory for storing PCH and PCM <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>cache.limit</code></td><td><code>number</code></td><td><code>0</code></td></tr></tbody></table><p>Maximum number of cache files to keep. If the total exceeds this limit, clice deletes the oldest files automatically. Set to <code>0</code> to disable the limit. <br></p><h2 id="index" tabindex="-1">Index <a class="header-anchor" href="#index" aria-label="Permalink to "Index""></a></h2><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>index.dir</code></td><td><code>string</code></td><td><code>"${workspace}/.clice/index"</code></td></tr></tbody></table><p>Directory for storing index files. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>index.background</code></td><td><code>boolean</code></td><td><code>true</code></td></tr></tbody></table><p>Whether index files in the background. If <code>true</code>, clice will index files in the background when the server is idle. If <code>false</code>, you need to send an index request to index files. <br></p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>index.instantiation</code></td><td><code>boolean</code></td><td><code>true</code></td></tr></tbody></table><p>Whether index entities inside template instantiation. For example</p><div class="language-cpp vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">cpp</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">struct</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> X</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(); };</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">struct</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Y</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(); };</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">typename</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">template</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">X</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>();</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">int</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> main</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> foo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Y</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>();</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>If <code>index.instantiation</code> is <code>true</code>, clice will traverse declarations in template instantiation, such as <code>foo<X></code> and <code>foo<Y></code>, and index them. As a result, if you trigger <code>go-to-definition</code> on <code>foo</code> in <code>T::foo()</code>, clice will return the locations of <code>X::foo</code> and <code>Y::foo</code>.</p><p>If <code>index.instantiation</code> is <code>false</code>, clice will not index entities inside template instantiations, and <code>go-to-definition</code> will return no results. <br></p><h2 id="feature" tabindex="-1">Feature <a class="header-anchor" href="#feature" aria-label="Permalink to "Feature""></a></h2><h3 id="semantic-tokens" tabindex="-1">Semantic Tokens <a class="header-anchor" href="#semantic-tokens" aria-label="Permalink to "Semantic Tokens""></a></h3><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>feature.semanticTokens.typeMap</code></td><td><code>array</code> of <code>table</code></td><td><code>[]</code></td></tr><tr><td><code>feature.semanticTokens.modifierMap</code></td><td><code>array</code> of <code>table</code></td><td><code>[]</code></td></tr></tbody></table><p>Maps the customized semantic symbol kinds or modifier to LSP semantic token types or modifiers.</p><p>Example:</p><div class="language-toml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">toml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">feature</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">semanticTokens</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">typeMap = [</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {"from": "header", "to": "string"},</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {"from": "attribute", "to": "decorator"},</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">modifierMap = [</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {"from": "const", "to": "readonly"},</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {"from": "pureVirtual", "to": "abstract"},</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span></code></pre></div><p>For all clice symbol kinds, please refer to <a href="https://github.com/clice-project/clice/blob/main/include/AST/SymbolKind.h" target="_blank" rel="noreferrer">SymbolKind</a>. The first letter of the name should be translated to lowercase. For all LSP semantic token types, refer to <a href="https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens" target="_blank" rel="noreferrer">SemanticTokenKind</a>.</p><table tabindex="0"><thead><tr><th>Name</th><th>Type</th><th>Default</th></tr></thead><tbody><tr><td><code>feature.semanticTokens.standard</code></td><td><code>boolean</code></td><td><code>false</code></td></tr></tbody></table><p>If <code>true</code>, clice will map the semantic token types and modifiers to the standard ones automatically.</p><h3 id="folding-range" tabindex="-1">Folding Range <a class="header-anchor" href="#folding-range" aria-label="Permalink to "Folding Range""></a></h3></div></div></main><footer class="VPDocFooter" data-v-e6f2a212 data-v-1bcd8184><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-1bcd8184><span class="visually-hidden" id="doc-footer-aria-label" data-v-1bcd8184>Pager</span><div class="pager" data-v-1bcd8184><!----></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/guide.html" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Guide</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
|
||
<script>window.__VP_HASH_MAP__=JSON.parse("{\"build.md\":\"Co74jVci\",\"configuration.md\":\"CpRedDOQ\",\"contribution.md\":\"Zb0EHW2I\",\"design_architecture.md\":\"C7gHe7F3\",\"design_clangd.md\":\"Bf0uxymm\",\"design_dependent-name.md\":\"CV61gbuX\",\"design_design.md\":\"C2BgqDzh\",\"design_index.md\":\"DRSC8Xmj\",\"design_markdown-examples.md\":\"CpB9tZ0M\",\"design_protocol.md\":\"DF8r9ZnS\",\"feature_document-symbol.md\":\"DsqxMq4k\",\"feature_folding-range.md\":\"2DTooAm1\",\"feature_inlay-hint.md\":\"D7ZN-35G\",\"feature_semantic-tokens.md\":\"B5B0Hwzv\",\"guide_quick-start.md\":\"CwDrTxXo\",\"index.md\":\"9zIdimQ1\",\"zh_design_compilation-task.md\":\"CRasWF8z\",\"zh_design_header-context.md\":\"JzQT9F1p\",\"zh_design_template-resolver.md\":\"fGt2KNxS\",\"zh_development_build.md\":\"DQ0u_rdw\",\"zh_development_contribution.md\":\"VhnPZehF\",\"zh_guide_quick-start.md\":\"DMOksTiB\",\"zh_guide_roadmap.md\":\"BIO2ru79\",\"zh_guide_what-is-clice.md\":\"C7OJIBOU\",\"zh_index.md\":\"CVx52Udt\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"clice\",\"description\":\"a powerful and modern C++ language server\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Home\",\"link\":\"/\"},{\"text\":\"Examples\",\"link\":\"/markdown-examples\"}],\"sidebar\":[{\"text\":\"Guide\",\"items\":[{\"text\":\"Guide\",\"link\":\"/guide\"},{\"text\":\"Runtime API Examples\",\"link\":\"/api-examples\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/clice-project/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
||
|
||
</body>
|
||
</html> |