This commit is contained in:
16bit-ykiko
2025-09-14 09:20:25 +00:00
parent f1f8e4d8c5
commit 61b3d0848e
77 changed files with 199 additions and 199 deletions

View File

@@ -5,18 +5,18 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>404 | clice</title>
<meta name="description" content="Not Found">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.js"></script>
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<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>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

View File

@@ -1 +1 @@
import{R as p}from"./chunks/theme.Bcb8IYOc.js";import{R as s,a1 as i,a2 as u,a3 as c,a4 as l,a5 as f,a6 as d,a7 as m,a8 as h,a9 as g,aa as A,d as v,u as R,v as w,s as y,ab as C,ac as P,ad as b,a0 as E}from"./chunks/framework.U1Gow_7P.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
import{R as p}from"./chunks/theme.rf236kCY.js";import{R as s,a1 as i,a2 as u,a3 as c,a4 as l,a5 as f,a6 as d,a7 as m,a8 as h,a9 as g,aa as A,d as v,u as R,v as w,s as y,ab as C,ac as P,ad as b,a0 as E}from"./chunks/framework.D8webtH5.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.U1Gow_7P.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"design/architecture.md","filePath":"en/design/architecture.md"}'),i={name:"design/architecture.md"};function n(s,e,c,l,h,p){return t(),r("div",null,e[0]||(e[0]=[o('<h1 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;"></a></h1><h2 id="protocol" tabindex="-1">Protocol <a class="header-anchor" href="#protocol" aria-label="Permalink to &quot;Protocol&quot;"></a></h2><p>Use C++ to describe type definitions in the <a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/" target="_blank" rel="noreferrer">Language Server Protocol</a>.</p><h2 id="ast" tabindex="-1">AST <a class="header-anchor" href="#ast" aria-label="Permalink to &quot;AST&quot;"></a></h2><p>Some convenient wrappers for clang AST interfaces.</p><h2 id="async" tabindex="-1">Async <a class="header-anchor" href="#async" aria-label="Permalink to &quot;Async&quot;"></a></h2><p>Wrapper for libuv coroutines using C++20 coroutines.</p><h2 id="compiler" tabindex="-1">Compiler <a class="header-anchor" href="#compiler" aria-label="Permalink to &quot;Compiler&quot;"></a></h2><p>Wrapper for clang compilation interfaces, responsible for actual compilation processes and obtaining various compilation information.</p><h2 id="feature" tabindex="-1">Feature <a class="header-anchor" href="#feature" aria-label="Permalink to &quot;Feature&quot;"></a></h2><p>Specific implementations of various LSP features.</p><h2 id="server" tabindex="-1">Server <a class="header-anchor" href="#server" aria-label="Permalink to &quot;Server&quot;"></a></h2><p>clice is a language server, first and foremost a server. It uses <a href="https://github.com/libuv/libuv" target="_blank" rel="noreferrer">libuv</a> as the event library, adopting a common event-driven compilation model. The main thread is responsible for handling requests and dispatching tasks, while the thread pool is responsible for executing time-consuming tasks, such as compilation tasks. Related code is located in the <code>Server</code> directory.</p><h2 id="support" tabindex="-1">Support <a class="header-anchor" href="#support" aria-label="Permalink to &quot;Support&quot;"></a></h2><p>Some other utility libraries.</p>',15)]))}const f=a(i,[["render",n]]);export{d as __pageData,f as default};
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.D8webtH5.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"design/architecture.md","filePath":"en/design/architecture.md"}'),i={name:"design/architecture.md"};function n(s,e,c,l,h,p){return t(),r("div",null,e[0]||(e[0]=[o('<h1 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;"></a></h1><h2 id="protocol" tabindex="-1">Protocol <a class="header-anchor" href="#protocol" aria-label="Permalink to &quot;Protocol&quot;"></a></h2><p>Use C++ to describe type definitions in the <a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/" target="_blank" rel="noreferrer">Language Server Protocol</a>.</p><h2 id="ast" tabindex="-1">AST <a class="header-anchor" href="#ast" aria-label="Permalink to &quot;AST&quot;"></a></h2><p>Some convenient wrappers for clang AST interfaces.</p><h2 id="async" tabindex="-1">Async <a class="header-anchor" href="#async" aria-label="Permalink to &quot;Async&quot;"></a></h2><p>Wrapper for libuv coroutines using C++20 coroutines.</p><h2 id="compiler" tabindex="-1">Compiler <a class="header-anchor" href="#compiler" aria-label="Permalink to &quot;Compiler&quot;"></a></h2><p>Wrapper for clang compilation interfaces, responsible for actual compilation processes and obtaining various compilation information.</p><h2 id="feature" tabindex="-1">Feature <a class="header-anchor" href="#feature" aria-label="Permalink to &quot;Feature&quot;"></a></h2><p>Specific implementations of various LSP features.</p><h2 id="server" tabindex="-1">Server <a class="header-anchor" href="#server" aria-label="Permalink to &quot;Server&quot;"></a></h2><p>clice is a language server, first and foremost a server. It uses <a href="https://github.com/libuv/libuv" target="_blank" rel="noreferrer">libuv</a> as the event library, adopting a common event-driven compilation model. The main thread is responsible for handling requests and dispatching tasks, while the thread pool is responsible for executing time-consuming tasks, such as compilation tasks. Related code is located in the <code>Server</code> directory.</p><h2 id="support" tabindex="-1">Support <a class="header-anchor" href="#support" aria-label="Permalink to &quot;Support&quot;"></a></h2><p>Some other utility libraries.</p>',15)]))}const f=a(i,[["render",n]]);export{d as __pageData,f as default};

View File

@@ -1 +1 @@
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.U1Gow_7P.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"design/architecture.md","filePath":"en/design/architecture.md"}'),i={name:"design/architecture.md"};function n(s,e,c,l,h,p){return t(),r("div",null,e[0]||(e[0]=[o("",15)]))}const f=a(i,[["render",n]]);export{d as __pageData,f as default};
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.D8webtH5.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"design/architecture.md","filePath":"en/design/architecture.md"}'),i={name:"design/architecture.md"};function n(s,e,c,l,h,p){return t(),r("div",null,e[0]||(e[0]=[o("",15)]))}const f=a(i,[["render",n]]);export{d as __pageData,f as default};

View File

@@ -1,4 +1,4 @@
import{_ as i,c as a,o as s,ae as t}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"design/compilation.md","filePath":"en/design/compilation.md"}'),n={name:"design/compilation.md"};function l(o,e,r,p,c,h){return s(),a("div",null,e[0]||(e[0]=[t(`<h1 id="compilation" tabindex="-1">Compilation <a class="header-anchor" href="#compilation" aria-label="Permalink to &quot;Compilation&quot;"></a></h1><h2 id="incremental-parsing" tabindex="-1">Incremental Parsing <a class="header-anchor" href="#incremental-parsing" aria-label="Permalink to &quot;Incremental Parsing&quot;"></a></h2><p>Every time you modify code, clice must re-parse the file. clice uses a mechanism called preamble to implement incremental compilation to speed up re-parsing. Preamble can be considered a special case of <a href="https://clang.llvm.org/docs/PCHInternals.html" target="_blank" rel="noreferrer">Precompiled Header</a> (embedded in source files). When opening a file, it builds the first few preprocessor directives at the beginning of the file (called preamble) into a PCH cache on disk. Later, when parsing, it can directly load the PCH file, thus skipping the first few preprocessor directives, which can greatly reduce the amount of code that needs to be re-parsed.</p><p>For example, for the following code:</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;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;iostream&gt;</span></span>
import{_ as i,c as a,o as s,ae as t}from"./chunks/framework.D8webtH5.js";const m=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"design/compilation.md","filePath":"en/design/compilation.md"}'),n={name:"design/compilation.md"};function l(o,e,r,p,c,h){return s(),a("div",null,e[0]||(e[0]=[t(`<h1 id="compilation" tabindex="-1">Compilation <a class="header-anchor" href="#compilation" aria-label="Permalink to &quot;Compilation&quot;"></a></h1><h2 id="incremental-parsing" tabindex="-1">Incremental Parsing <a class="header-anchor" href="#incremental-parsing" aria-label="Permalink to &quot;Incremental Parsing&quot;"></a></h2><p>Every time you modify code, clice must re-parse the file. clice uses a mechanism called preamble to implement incremental compilation to speed up re-parsing. Preamble can be considered a special case of <a href="https://clang.llvm.org/docs/PCHInternals.html" target="_blank" rel="noreferrer">Precompiled Header</a> (embedded in source files). When opening a file, it builds the first few preprocessor directives at the beginning of the file (called preamble) into a PCH cache on disk. Later, when parsing, it can directly load the PCH file, thus skipping the first few preprocessor directives, which can greatly reduce the amount of code that needs to be re-parsed.</p><p>For example, for the following code:</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;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;iostream&gt;</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;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::cout </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Hello world!&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::endl;</span></span>

View File

@@ -1 +1 @@
import{_ as i,c as a,o as s,ae as t}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"design/compilation.md","filePath":"en/design/compilation.md"}'),n={name:"design/compilation.md"};function l(o,e,r,p,c,h){return s(),a("div",null,e[0]||(e[0]=[t("",7)]))}const k=i(n,[["render",l]]);export{m as __pageData,k as default};
import{_ as i,c as a,o as s,ae as t}from"./chunks/framework.D8webtH5.js";const m=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"design/compilation.md","filePath":"en/design/compilation.md"}'),n={name:"design/compilation.md"};function l(o,e,r,p,c,h){return s(),a("div",null,e[0]||(e[0]=[t("",7)]))}const k=i(n,[["render",l]]);export{m as __pageData,k as default};

View File

@@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,ae as n}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"design/header-context.md","filePath":"en/design/header-context.md"}'),t={name:"design/header-context.md"};function o(l,e,p,c,d,h){return a(),i("div",null,e[0]||(e[0]=[n(`<h1 id="header-context" tabindex="-1">Header Context <a class="header-anchor" href="#header-context" aria-label="Permalink to &quot;Header Context&quot;"></a></h1><p>For clangd to work properly, users often need to provide a <code>compile_commands.json</code> file (hereinafter referred to as CDB file). The basic compilation unit of C++&#39;s traditional compilation model is a source file (e.g., <code>.c</code> and <code>.cpp</code> files), where <code>#include</code> simply pastes and copies the content of header files to the corresponding position in the source file. The aforementioned CDB file stores the compilation commands corresponding to each source file. When you open a source file, clangd will use its corresponding compilation command in the CDB to compile this file.</p><p>Naturally, there&#39;s a question: if the CDB file only contains compilation commands for source files and not header files, how does clangd handle header files? clangd treats header files as source files, and then, according to some rules, such as using the compilation command of the source file in the corresponding directory as the compilation command for that header file. This model is simple and effective, but it ignores some situations.</p><p>Since header files are part of source files, there will be cases where their content differs depending on the content that precedes them in the source file. 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>
import{_ as s,c as i,o as a,ae as n}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"design/header-context.md","filePath":"en/design/header-context.md"}'),t={name:"design/header-context.md"};function o(l,e,p,c,d,h){return a(),i("div",null,e[0]||(e[0]=[n(`<h1 id="header-context" tabindex="-1">Header Context <a class="header-anchor" href="#header-context" aria-label="Permalink to &quot;Header Context&quot;"></a></h1><p>For clangd to work properly, users often need to provide a <code>compile_commands.json</code> file (hereinafter referred to as CDB file). The basic compilation unit of C++&#39;s traditional compilation model is a source file (e.g., <code>.c</code> and <code>.cpp</code> files), where <code>#include</code> simply pastes and copies the content of header files to the corresponding position in the source file. The aforementioned CDB file stores the compilation commands corresponding to each source file. When you open a source file, clangd will use its corresponding compilation command in the CDB to compile this file.</p><p>Naturally, there&#39;s a question: if the CDB file only contains compilation commands for source files and not header files, how does clangd handle header files? clangd treats header files as source files, and then, according to some rules, such as using the compilation command of the source file in the corresponding directory as the compilation command for that header file. This model is simple and effective, but it ignores some situations.</p><p>Since header files are part of source files, there will be cases where their content differs depending on the content that precedes them in the source file. 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;">#ifdef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> TEST</span></span>
<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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#else</span></span>

View File

@@ -1 +1 @@
import{_ as s,c as i,o as a,ae as n}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"design/header-context.md","filePath":"en/design/header-context.md"}'),t={name:"design/header-context.md"};function o(l,e,p,c,d,h){return a(),i("div",null,e[0]||(e[0]=[n("",10)]))}const f=s(t,[["render",o]]);export{k as __pageData,f as default};
import{_ as s,c as i,o as a,ae as n}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"design/header-context.md","filePath":"en/design/header-context.md"}'),t={name:"design/header-context.md"};function o(l,e,p,c,d,h){return a(),i("div",null,e[0]||(e[0]=[n("",10)]))}const f=s(t,[["render",o]]);export{k as __pageData,f as default};

View File

@@ -1 +1 @@
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"design/index.md","filePath":"en/design/index.md"}'),s={name:"design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const _=n(s,[["render",i]]);export{f as __pageData,_ as default};
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.D8webtH5.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"design/index.md","filePath":"en/design/index.md"}'),s={name:"design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const _=n(s,[["render",i]]);export{f as __pageData,_ as default};

View File

@@ -1 +1 @@
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"design/index.md","filePath":"en/design/index.md"}'),s={name:"design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const _=n(s,[["render",i]]);export{f as __pageData,_ as default};
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.D8webtH5.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"design/index.md","filePath":"en/design/index.md"}'),s={name:"design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const _=n(s,[["render",i]]);export{f as __pageData,_ as default};

View File

@@ -1,4 +1,4 @@
import{_ as s,c as t,o as i,ae as a}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"design/template-resolver.md","filePath":"en/design/template-resolver.md"}'),n={name:"design/template-resolver.md"};function p(l,e,o,r,h,d){return i(),t("div",null,e[0]||(e[0]=[a(`<h1 id="template-resolver" tabindex="-1">Template Resolver <a class="header-anchor" href="#template-resolver" aria-label="Permalink to &quot;Template Resolver&quot;"></a></h1><p>First, there&#39;s better template support, which is also the feature I initially wanted clangd to support. Specifically, what problems are there currently in handling templates?</p><p>Take code completion as an example. Consider the following code, where <code>^</code> represents the cursor position:</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;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</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;">&gt;</span></span>
import{_ as s,c as t,o as i,ae as a}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"design/template-resolver.md","filePath":"en/design/template-resolver.md"}'),n={name:"design/template-resolver.md"};function p(l,e,o,r,h,d){return i(),t("div",null,e[0]||(e[0]=[a(`<h1 id="template-resolver" tabindex="-1">Template Resolver <a class="header-anchor" href="#template-resolver" aria-label="Permalink to &quot;Template Resolver&quot;"></a></h1><p>First, there&#39;s better template support, which is also the feature I initially wanted clangd to support. Specifically, what problems are there currently in handling templates?</p><p>Take code completion as an example. Consider the following code, where <code>^</code> represents the cursor position:</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;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</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;">&gt;</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:#6F42C1;--shiki-dark:#B392F0;">std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">vec</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> vec.</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">^</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>In C++, if a type depends on template parameters, we cannot make any accurate assumptions about it before template instantiation. For example, here <code>vector</code> could be either the primary template or the partial specialization of <code>vector&lt;bool&gt;</code>. Which one should we choose? For code compilation, accuracy is always the most important - we cannot use any results that might lead to errors. But for language servers, providing more possible results is often better than providing nothing. We can assume that users use the primary template more often than partial specializations, and thus provide code completion results based on the primary template. Currently, clangd does exactly this - in the above case, it will provide code completion based on the primary template of <code>vector</code>.</p><p>Consider a more complex 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;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</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;">&gt;</span></span>

View File

@@ -1 +1 @@
import{_ as s,c as t,o as i,ae as a}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"design/template-resolver.md","filePath":"en/design/template-resolver.md"}'),n={name:"design/template-resolver.md"};function p(l,e,o,r,h,d){return i(),t("div",null,e[0]||(e[0]=[a("",10)]))}const m=s(n,[["render",p]]);export{k as __pageData,m as default};
import{_ as s,c as t,o as i,ae as a}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"design/template-resolver.md","filePath":"en/design/template-resolver.md"}'),n={name:"design/template-resolver.md"};function p(l,e,o,r,h,d){return i(),t("div",null,e[0]||(e[0]=[a("",10)]))}const m=s(n,[["render",p]]);export{k as __pageData,m as default};

View File

@@ -1,4 +1,4 @@
import{_ as s,c as a,o as l,ae as e}from"./chunks/framework.U1Gow_7P.js";const c=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"dev/build.md","filePath":"en/dev/build.md"}'),n={name:"dev/build.md"};function t(h,i,p,k,r,o){return l(),a("div",null,i[0]||(i[0]=[e(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to &quot;Build from Source&quot;"></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to &quot;Supported Platforms&quot;"></a></h2><ul><li>Windows</li><li>Linux</li><li>MacOS</li></ul><h2 id="prerequisites" tabindex="-1">Prerequisites <a class="header-anchor" href="#prerequisites" aria-label="Permalink to &quot;Prerequisites&quot;"></a></h2><p>This section introduces the prerequisites for compiling clice.</p><h3 id="toolchain" tabindex="-1">Toolchain <a class="header-anchor" href="#toolchain" aria-label="Permalink to &quot;Toolchain&quot;"></a></h3><ul><li>clang &gt;= 19</li><li>c++23 compatible standard library <ul><li>MSVC STL &gt;= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ &gt;= 14</li><li>Clang libc++ &gt;= 20</li></ul></li></ul><p>clice uses C++23 as the language standard. Please ensure you have an available clang 19 or above compiler, as well as a standard library compatible with C++23.</p><blockquote><p>clice can currently only be compiled with clang. In the future, we will improve this to allow compilation with gcc and msvc.</p></blockquote><h3 id="llvm-libs" tabindex="-1">LLVM Libs <a class="header-anchor" href="#llvm-libs" aria-label="Permalink to &quot;LLVM Libs&quot;"></a></h3><ul><li>20.1.5 &lt;= llvm libs &lt; 21</li></ul><p>Due to the complexity of C++ syntax, writing a new parser from scratch is unrealistic. clice calls clang&#39;s API to parse C++ source files and obtain AST, which means it needs to link llvm/clang libs. Additionally, since clice uses clang&#39;s private headers, these private headers are not available in llvm&#39;s binary release, so you cannot directly use the system&#39;s llvm package.</p><p>If you can find the llvm commit corresponding to your system&#39;s llvm package, copy the following three files from that commit:</p><ul><li><code>clang/lib/Sema/CoroutineStmtBuilder.h</code></li><li><code>clang/lib/Sema/TypeLocBuilder.h</code></li><li><code>clang/lib/Sema/TreeTransform.h</code></li></ul><p>Copy them to <code>LLVM_INSTALL_PATH/include/clang/Sema/</code>.</p><p>Besides this method, there are two other ways to obtain the llvm libs required by clice:</p><ol><li>Use our precompiled version</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># .github/workflows/cmake.yml</span></span>
import{_ as s,c as a,o as l,ae as e}from"./chunks/framework.D8webtH5.js";const c=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"dev/build.md","filePath":"en/dev/build.md"}'),n={name:"dev/build.md"};function t(h,i,p,k,r,o){return l(),a("div",null,i[0]||(i[0]=[e(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to &quot;Build from Source&quot;"></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to &quot;Supported Platforms&quot;"></a></h2><ul><li>Windows</li><li>Linux</li><li>MacOS</li></ul><h2 id="prerequisites" tabindex="-1">Prerequisites <a class="header-anchor" href="#prerequisites" aria-label="Permalink to &quot;Prerequisites&quot;"></a></h2><p>This section introduces the prerequisites for compiling clice.</p><h3 id="toolchain" tabindex="-1">Toolchain <a class="header-anchor" href="#toolchain" aria-label="Permalink to &quot;Toolchain&quot;"></a></h3><ul><li>clang &gt;= 19</li><li>c++23 compatible standard library <ul><li>MSVC STL &gt;= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ &gt;= 14</li><li>Clang libc++ &gt;= 20</li></ul></li></ul><p>clice uses C++23 as the language standard. Please ensure you have an available clang 19 or above compiler, as well as a standard library compatible with C++23.</p><blockquote><p>clice can currently only be compiled with clang. In the future, we will improve this to allow compilation with gcc and msvc.</p></blockquote><h3 id="llvm-libs" tabindex="-1">LLVM Libs <a class="header-anchor" href="#llvm-libs" aria-label="Permalink to &quot;LLVM Libs&quot;"></a></h3><ul><li>20.1.5 &lt;= llvm libs &lt; 21</li></ul><p>Due to the complexity of C++ syntax, writing a new parser from scratch is unrealistic. clice calls clang&#39;s API to parse C++ source files and obtain AST, which means it needs to link llvm/clang libs. Additionally, since clice uses clang&#39;s private headers, these private headers are not available in llvm&#39;s binary release, so you cannot directly use the system&#39;s llvm package.</p><p>If you can find the llvm commit corresponding to your system&#39;s llvm package, copy the following three files from that commit:</p><ul><li><code>clang/lib/Sema/CoroutineStmtBuilder.h</code></li><li><code>clang/lib/Sema/TypeLocBuilder.h</code></li><li><code>clang/lib/Sema/TreeTransform.h</code></li></ul><p>Copy them to <code>LLVM_INSTALL_PATH/include/clang/Sema/</code>.</p><p>Besides this method, there are two other ways to obtain the llvm libs required by clice:</p><ol><li>Use our precompiled version</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># .github/workflows/cmake.yml</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Linux precompiled binary require glibc 2.35 (build on ubuntu 22.04)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./.llvm</span></span>

View File

@@ -1 +1 @@
import{_ as s,c as a,o as l,ae as e}from"./chunks/framework.U1Gow_7P.js";const c=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"dev/build.md","filePath":"en/dev/build.md"}'),n={name:"dev/build.md"};function t(h,i,p,k,r,o){return l(),a("div",null,i[0]||(i[0]=[e("",46)]))}const F=s(n,[["render",t]]);export{c as __pageData,F as default};
import{_ as s,c as a,o as l,ae as e}from"./chunks/framework.D8webtH5.js";const c=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"dev/build.md","filePath":"en/dev/build.md"}'),n={name:"dev/build.md"};function t(h,i,p,k,r,o){return l(),a("div",null,i[0]||(i[0]=[e("",46)]))}const F=s(n,[["render",t]]);export{c as __pageData,F as default};

View File

@@ -1 +1 @@
import{_ as t,c as a,o,ae as n}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"dev/contribution.md","filePath":"en/dev/contribution.md"}'),i={name:"dev/contribution.md"};function r(l,e,s,c,d,u){return o(),a("div",null,e[0]||(e[0]=[n('<h1 id="contribution" tabindex="-1">Contribution <a class="header-anchor" href="#contribution" aria-label="Permalink to &quot;Contribution&quot;"></a></h1><p>We welcome any contributions!</p><p>Please refer to <a href="./build">build</a> to build clice, refer to <a href="./test-and-debug">test and debug</a> to test and debug clice.</p><h2 id="code-style" tabindex="-1">Code Style <a class="header-anchor" href="#code-style" aria-label="Permalink to &quot;Code Style&quot;"></a></h2><p>Naming:</p><ul><li>Variable names: lowercase with underscores</li><li>Class names, enum names: PascalCase</li></ul>',6)]))}const m=t(i,[["render",r]]);export{_ as __pageData,m as default};
import{_ as t,c as a,o,ae as n}from"./chunks/framework.D8webtH5.js";const _=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"dev/contribution.md","filePath":"en/dev/contribution.md"}'),i={name:"dev/contribution.md"};function r(l,e,s,c,d,u){return o(),a("div",null,e[0]||(e[0]=[n('<h1 id="contribution" tabindex="-1">Contribution <a class="header-anchor" href="#contribution" aria-label="Permalink to &quot;Contribution&quot;"></a></h1><p>We welcome any contributions!</p><p>Please refer to <a href="./build">build</a> to build clice, refer to <a href="./test-and-debug">test and debug</a> to test and debug clice.</p><h2 id="code-style" tabindex="-1">Code Style <a class="header-anchor" href="#code-style" aria-label="Permalink to &quot;Code Style&quot;"></a></h2><p>Naming:</p><ul><li>Variable names: lowercase with underscores</li><li>Class names, enum names: PascalCase</li></ul>',6)]))}const m=t(i,[["render",r]]);export{_ as __pageData,m as default};

View File

@@ -1 +1 @@
import{_ as t,c as a,o,ae as n}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"dev/contribution.md","filePath":"en/dev/contribution.md"}'),i={name:"dev/contribution.md"};function r(l,e,s,c,d,u){return o(),a("div",null,e[0]||(e[0]=[n("",6)]))}const m=t(i,[["render",r]]);export{_ as __pageData,m as default};
import{_ as t,c as a,o,ae as n}from"./chunks/framework.D8webtH5.js";const _=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"dev/contribution.md","filePath":"en/dev/contribution.md"}'),i={name:"dev/contribution.md"};function r(l,e,s,c,d,u){return o(),a("div",null,e[0]||(e[0]=[n("",6)]))}const m=t(i,[["render",r]]);export{_ as __pageData,m as default};

View File

@@ -1,4 +1,4 @@
import{_ as i,c as e,o as t,ae as a}from"./chunks/framework.U1Gow_7P.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"dev/test-and-debug.md","filePath":"en/dev/test-and-debug.md"}'),n={name:"dev/test-and-debug.md"};function l(h,s,p,o,d,c){return t(),e("div",null,s[0]||(s[0]=[a(`<h1 id="test-and-debug" tabindex="-1">Test and Debug <a class="header-anchor" href="#test-and-debug" aria-label="Permalink to &quot;Test and Debug&quot;"></a></h1><h2 id="run-tests" tabindex="-1">Run Tests <a class="header-anchor" href="#run-tests" aria-label="Permalink to &quot;Run Tests&quot;"></a></h2><p>clice has two types of tests: unit tests and integration tests.</p><ul><li>Run unit tests</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./build/bin/unit_tests</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --test-dir=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;./tests/data&quot;</span></span></code></pre></div><ul><li>Run integration tests</li></ul><p>We use pytest to run integration tests. Please refer to <code>pyproject.toml</code> to install the required Python libraries.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pytest</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --log-cli-level=INFO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --executable=./build/bin/clice</span></span></code></pre></div><p>If you use xmake as your build system, you can run the tests directly with xmake:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --verbose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> unit_tests</span></span>
import{_ as i,c as e,o as t,ae as a}from"./chunks/framework.D8webtH5.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"dev/test-and-debug.md","filePath":"en/dev/test-and-debug.md"}'),n={name:"dev/test-and-debug.md"};function l(h,s,p,o,d,c){return t(),e("div",null,s[0]||(s[0]=[a(`<h1 id="test-and-debug" tabindex="-1">Test and Debug <a class="header-anchor" href="#test-and-debug" aria-label="Permalink to &quot;Test and Debug&quot;"></a></h1><h2 id="run-tests" tabindex="-1">Run Tests <a class="header-anchor" href="#run-tests" aria-label="Permalink to &quot;Run Tests&quot;"></a></h2><p>clice has two types of tests: unit tests and integration tests.</p><ul><li>Run unit tests</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./build/bin/unit_tests</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --test-dir=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;./tests/data&quot;</span></span></code></pre></div><ul><li>Run integration tests</li></ul><p>We use pytest to run integration tests. Please refer to <code>pyproject.toml</code> to install the required Python libraries.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pytest</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --log-cli-level=INFO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --executable=./build/bin/clice</span></span></code></pre></div><p>If you use xmake as your build system, you can run the tests directly with xmake:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --verbose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> unit_tests</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> test</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --verbose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> integration_tests/default</span></span></code></pre></div><h2 id="debug" tabindex="-1">Debug <a class="header-anchor" href="#debug" aria-label="Permalink to &quot;Debug&quot;"></a></h2><p>If you want to attach a debugger to clice for debugging, it is recommended to first start clice in socket mode independently, and then connect the client to it.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./build/bin/clice</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=socket</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --port=50051</span></span></code></pre></div><p>After the server starts, you can connect a client to the server in the following two ways:</p><ul><li>Connect by running a specific test with pytest</li></ul><p>You can run a single integration test case to connect to a running clice instance. This is very useful for reproducing and debugging specific scenarios.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pytest</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --log-cli-level=INFO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration/test_file_operation.py::test_did_open</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=socket</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --port=50051</span></span></code></pre></div><ul><li>Use VS Code for practical testing</li></ul><p>You can also connect to a running clice service by configuring the clice-vscode extension, allowing you to debug in a real-world usage scenario.</p><ol><li><p>Download the <a href="https://marketplace.visualstudio.com/items?itemName=ykiko.clice-vscode" target="_blank" rel="noreferrer">clice-vscode</a> extension from the Marketplace.</p></li><li><p>Configure <code>settings.json</code>: Create a <code>.vscode/settings.json</code> file in your project&#39;s root directory and add the following content:</p><div class="language-jsonc vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">jsonc</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>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Point this to the clice binary you downloaded.</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;clice.executable&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;/path/to/your/clice/executable&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>

View File

@@ -1 +1 @@
import{_ as i,c as e,o as t,ae as a}from"./chunks/framework.U1Gow_7P.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"dev/test-and-debug.md","filePath":"en/dev/test-and-debug.md"}'),n={name:"dev/test-and-debug.md"};function l(h,s,p,o,d,c){return t(),e("div",null,s[0]||(s[0]=[a("",22)]))}const g=i(n,[["render",l]]);export{r as __pageData,g as default};
import{_ as i,c as e,o as t,ae as a}from"./chunks/framework.D8webtH5.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"dev/test-and-debug.md","filePath":"en/dev/test-and-debug.md"}'),n={name:"dev/test-and-debug.md"};function l(h,s,p,o,d,c){return t(),e("div",null,s[0]||(s[0]=[a("",22)]))}const g=i(n,[["render",l]]);export{r as __pageData,g as default};

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import{_ as t,c as o,o as a,ae as d}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"guide/configuration.md","filePath":"en/guide/configuration.md"}'),r={name:"guide/configuration.md"};function c(i,e,l,n,h,s){return a(),o("div",null,e[0]||(e[0]=[d("",30)]))}const p=t(r,[["render",c]]);export{f as __pageData,p as default};
import{_ as t,c as o,o as a,ae as d}from"./chunks/framework.D8webtH5.js";const f=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"guide/configuration.md","filePath":"en/guide/configuration.md"}'),r={name:"guide/configuration.md"};function c(i,e,l,n,h,s){return a(),o("div",null,e[0]||(e[0]=[d("",30)]))}const p=t(r,[["render",c]]);export{f as __pageData,p as default};

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import{_ as a,c as o,o as t,ae as i}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"guide/quick-start.md","filePath":"en/guide/quick-start.md"}'),r={name:"guide/quick-start.md"};function s(l,e,n,c,d,h){return t(),o("div",null,e[0]||(e[0]=[i("",31)]))}const m=a(r,[["render",s]]);export{p as __pageData,m as default};
import{_ as a,c as o,o as t,ae as i}from"./chunks/framework.D8webtH5.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"guide/quick-start.md","filePath":"en/guide/quick-start.md"}'),r={name:"guide/quick-start.md"};function s(l,e,n,c,d,h){return t(),o("div",null,e[0]||(e[0]=[i("",31)]))}const m=a(r,[["render",s]]);export{p as __pageData,m as default};

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
import{_ as t,c as a,o,ae as n}from"./chunks/framework.U1Gow_7P.js";const u=JSON.parse('{"title":"What is clice?","description":"","frontmatter":{},"headers":[],"relativePath":"guide/what-is-clice.md","filePath":"en/guide/what-is-clice.md"}'),i={name:"guide/what-is-clice.md"};function s(r,e,l,d,h,c){return o(),a("div",null,e[0]||(e[0]=[n("",11)]))}const m=t(i,[["render",s]]);export{u as __pageData,m as default};
import{_ as t,c as a,o,ae as n}from"./chunks/framework.D8webtH5.js";const u=JSON.parse('{"title":"What is clice?","description":"","frontmatter":{},"headers":[],"relativePath":"guide/what-is-clice.md","filePath":"en/guide/what-is-clice.md"}'),i={name:"guide/what-is-clice.md"};function s(r,e,l,d,h,c){return o(),a("div",null,e[0]||(e[0]=[n("",11)]))}const m=t(i,[["render",s]]);export{u as __pageData,m as default};

View File

@@ -1 +1 @@
import{_ as e,c as t,o as n}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"Next Generation C++ Language Server","tagline":"Development is actively in progress","actions":[{"theme":"brand","text":"What is clice?","link":"/guide/what-is-clice"},{"theme":"alt","text":"Quick Start","link":"/guide/quick-start"},{"theme":"alt","text":"Contribution","link":"/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"Better Template Handling","details":"Use pseudo-instantiation to handle dependent template names, with code completion even for complex templates"},{"icon":"H","title":"Header File Context","details":"Support header file state switching between different source file contexts, and fully support non-self-contained files"},{"icon":"M","title":"Modules","details":"Excellent C++20 module support, from code completion to highlighting to navigation, all adapted"},{"icon":"I","title":"Better Performance","details":"Excellent asynchronous task scheduling, support for compilation task cancellation, caching necessary information, avoiding meaningless CPU waste"}]},"headers":[],"relativePath":"index.md","filePath":"en/index.md"}'),i={name:"index.md"};function a(o,l,s,c,r,d){return n(),t("div")}const u=e(i,[["render",a]]);export{m as __pageData,u as default};
import{_ as e,c as t,o as n}from"./chunks/framework.D8webtH5.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"Next Generation C++ Language Server","tagline":"Development is actively in progress","actions":[{"theme":"brand","text":"What is clice?","link":"/guide/what-is-clice"},{"theme":"alt","text":"Quick Start","link":"/guide/quick-start"},{"theme":"alt","text":"Contribution","link":"/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"Better Template Handling","details":"Use pseudo-instantiation to handle dependent template names, with code completion even for complex templates"},{"icon":"H","title":"Header File Context","details":"Support header file state switching between different source file contexts, and fully support non-self-contained files"},{"icon":"M","title":"Modules","details":"Excellent C++20 module support, from code completion to highlighting to navigation, all adapted"},{"icon":"I","title":"Better Performance","details":"Excellent asynchronous task scheduling, support for compilation task cancellation, caching necessary information, avoiding meaningless CPU waste"}]},"headers":[],"relativePath":"index.md","filePath":"en/index.md"}'),i={name:"index.md"};function a(o,l,s,c,r,d){return n(),t("div")}const u=e(i,[["render",a]]);export{m as __pageData,u as default};

View File

@@ -1 +1 @@
import{_ as e,c as t,o as n}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"Next Generation C++ Language Server","tagline":"Development is actively in progress","actions":[{"theme":"brand","text":"What is clice?","link":"/guide/what-is-clice"},{"theme":"alt","text":"Quick Start","link":"/guide/quick-start"},{"theme":"alt","text":"Contribution","link":"/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"Better Template Handling","details":"Use pseudo-instantiation to handle dependent template names, with code completion even for complex templates"},{"icon":"H","title":"Header File Context","details":"Support header file state switching between different source file contexts, and fully support non-self-contained files"},{"icon":"M","title":"Modules","details":"Excellent C++20 module support, from code completion to highlighting to navigation, all adapted"},{"icon":"I","title":"Better Performance","details":"Excellent asynchronous task scheduling, support for compilation task cancellation, caching necessary information, avoiding meaningless CPU waste"}]},"headers":[],"relativePath":"index.md","filePath":"en/index.md"}'),i={name:"index.md"};function a(o,l,s,c,r,d){return n(),t("div")}const u=e(i,[["render",a]]);export{m as __pageData,u as default};
import{_ as e,c as t,o as n}from"./chunks/framework.D8webtH5.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"Next Generation C++ Language Server","tagline":"Development is actively in progress","actions":[{"theme":"brand","text":"What is clice?","link":"/guide/what-is-clice"},{"theme":"alt","text":"Quick Start","link":"/guide/quick-start"},{"theme":"alt","text":"Contribution","link":"/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"Better Template Handling","details":"Use pseudo-instantiation to handle dependent template names, with code completion even for complex templates"},{"icon":"H","title":"Header File Context","details":"Support header file state switching between different source file contexts, and fully support non-self-contained files"},{"icon":"M","title":"Modules","details":"Excellent C++20 module support, from code completion to highlighting to navigation, all adapted"},{"icon":"I","title":"Better Performance","details":"Excellent asynchronous task scheduling, support for compilation task cancellation, caching necessary information, avoiding meaningless CPU waste"}]},"headers":[],"relativePath":"index.md","filePath":"en/index.md"}'),i={name:"index.md"};function a(o,l,s,c,r,d){return n(),t("div")}const u=e(i,[["render",a]]);export{m as __pageData,u as default};

View File

@@ -1 +1 @@
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.U1Gow_7P.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/architecture.md","filePath":"zh/design/architecture.md"}'),i={name:"zh/design/architecture.md"};function c(l,e,h,n,s,u){return t(),r("div",null,e[0]||(e[0]=[o('<h1 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;"></a></h1><h2 id="protocol" tabindex="-1">Protocol <a class="header-anchor" href="#protocol" aria-label="Permalink to &quot;Protocol&quot;"></a></h2><p>使用 C++ 来描述 <a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/" target="_blank" rel="noreferrer">Language Server Protocol</a> 中的类型定义。</p><h2 id="ast" tabindex="-1">AST <a class="header-anchor" href="#ast" aria-label="Permalink to &quot;AST&quot;"></a></h2><p>对 clang AST 接口的一些方便的封装</p><h2 id="async" tabindex="-1">Async <a class="header-anchor" href="#async" aria-label="Permalink to &quot;Async&quot;"></a></h2><p>使用 C++20 coroutine 对 libuv 协程的封装</p><h2 id="compiler" tabindex="-1">Compiler <a class="header-anchor" href="#compiler" aria-label="Permalink to &quot;Compiler&quot;"></a></h2><p>对 clang 编译接口的封装,负责实际的编译过程,以及各种编译信息的获取。</p><h2 id="feature" tabindex="-1">Feature <a class="header-anchor" href="#feature" aria-label="Permalink to &quot;Feature&quot;"></a></h2><p>各种 LSP 特性的具体实现。</p><h2 id="server" tabindex="-1">Server <a class="header-anchor" href="#server" aria-label="Permalink to &quot;Server&quot;"></a></h2><p>clice 是一个语言服务器,首先是一个服务器。它使用 <a href="https://github.com/libuv/libuv" target="_blank" rel="noreferrer">libuv</a> 作为事件库,采用常见的事件驱动的编译模型。主线程负责处理请求以及分发任务,线程池负责执行耗时的任务,比如编译任务。相关的代码位于 <code>Server</code> 目录下。</p><h2 id="support" tabindex="-1">Support <a class="header-anchor" href="#support" aria-label="Permalink to &quot;Support&quot;"></a></h2><p>一些其它的工具库。</p>',15)]))}const f=a(i,[["render",c]]);export{d as __pageData,f as default};
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.D8webtH5.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/architecture.md","filePath":"zh/design/architecture.md"}'),i={name:"zh/design/architecture.md"};function c(l,e,h,n,s,u){return t(),r("div",null,e[0]||(e[0]=[o('<h1 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to &quot;Architecture&quot;"></a></h1><h2 id="protocol" tabindex="-1">Protocol <a class="header-anchor" href="#protocol" aria-label="Permalink to &quot;Protocol&quot;"></a></h2><p>使用 C++ 来描述 <a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/" target="_blank" rel="noreferrer">Language Server Protocol</a> 中的类型定义。</p><h2 id="ast" tabindex="-1">AST <a class="header-anchor" href="#ast" aria-label="Permalink to &quot;AST&quot;"></a></h2><p>对 clang AST 接口的一些方便的封装</p><h2 id="async" tabindex="-1">Async <a class="header-anchor" href="#async" aria-label="Permalink to &quot;Async&quot;"></a></h2><p>使用 C++20 coroutine 对 libuv 协程的封装</p><h2 id="compiler" tabindex="-1">Compiler <a class="header-anchor" href="#compiler" aria-label="Permalink to &quot;Compiler&quot;"></a></h2><p>对 clang 编译接口的封装,负责实际的编译过程,以及各种编译信息的获取。</p><h2 id="feature" tabindex="-1">Feature <a class="header-anchor" href="#feature" aria-label="Permalink to &quot;Feature&quot;"></a></h2><p>各种 LSP 特性的具体实现。</p><h2 id="server" tabindex="-1">Server <a class="header-anchor" href="#server" aria-label="Permalink to &quot;Server&quot;"></a></h2><p>clice 是一个语言服务器,首先是一个服务器。它使用 <a href="https://github.com/libuv/libuv" target="_blank" rel="noreferrer">libuv</a> 作为事件库,采用常见的事件驱动的编译模型。主线程负责处理请求以及分发任务,线程池负责执行耗时的任务,比如编译任务。相关的代码位于 <code>Server</code> 目录下。</p><h2 id="support" tabindex="-1">Support <a class="header-anchor" href="#support" aria-label="Permalink to &quot;Support&quot;"></a></h2><p>一些其它的工具库。</p>',15)]))}const f=a(i,[["render",c]]);export{d as __pageData,f as default};

View File

@@ -1 +1 @@
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.U1Gow_7P.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/architecture.md","filePath":"zh/design/architecture.md"}'),i={name:"zh/design/architecture.md"};function c(l,e,h,n,s,u){return t(),r("div",null,e[0]||(e[0]=[o("",15)]))}const f=a(i,[["render",c]]);export{d as __pageData,f as default};
import{_ as a,c as r,o as t,ae as o}from"./chunks/framework.D8webtH5.js";const d=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/architecture.md","filePath":"zh/design/architecture.md"}'),i={name:"zh/design/architecture.md"};function c(l,e,h,n,s,u){return t(),r("div",null,e[0]||(e[0]=[o("",15)]))}const f=a(i,[["render",c]]);export{d as __pageData,f as default};

View File

@@ -1,4 +1,4 @@
import{_ as i,c as s,o as e,ae as n}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation.md","filePath":"zh/design/compilation.md"}'),t={name:"zh/design/compilation.md"};function l(p,a,o,r,h,c){return e(),s("div",null,a[0]||(a[0]=[n(`<h1 id="compilation" tabindex="-1">Compilation <a class="header-anchor" href="#compilation" aria-label="Permalink to &quot;Compilation&quot;"></a></h1><h2 id="incremental-parsing" tabindex="-1">Incremental Parsing <a class="header-anchor" href="#incremental-parsing" aria-label="Permalink to &quot;Incremental Parsing&quot;"></a></h2><p>每当你修改代码时clice 都必须重新解析文件。clice 使用一种叫做 preamble 的机制实现增量编译以加快重新解析速度。preamble 可被视为 <a href="https://clang.llvm.org/docs/PCHInternals.html" target="_blank" rel="noreferrer">Precompiled Header</a> 的一种特殊情况(内嵌在源文件中)。在打开文件的时候,它会将文件开头的几个预处理指令(被叫做 preamble构建成 PCH 缓存在磁盘上,后续在解析的时候则可以直接加载 PCH 文件,从而跳过前面几个预处理指令,这样可以大大减少要重新解析的代码量。</p><p>例如,对于如下的代码</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;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;iostream&gt;</span></span>
import{_ as i,c as s,o as e,ae as n}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation.md","filePath":"zh/design/compilation.md"}'),t={name:"zh/design/compilation.md"};function l(p,a,o,r,h,c){return e(),s("div",null,a[0]||(a[0]=[n(`<h1 id="compilation" tabindex="-1">Compilation <a class="header-anchor" href="#compilation" aria-label="Permalink to &quot;Compilation&quot;"></a></h1><h2 id="incremental-parsing" tabindex="-1">Incremental Parsing <a class="header-anchor" href="#incremental-parsing" aria-label="Permalink to &quot;Incremental Parsing&quot;"></a></h2><p>每当你修改代码时clice 都必须重新解析文件。clice 使用一种叫做 preamble 的机制实现增量编译以加快重新解析速度。preamble 可被视为 <a href="https://clang.llvm.org/docs/PCHInternals.html" target="_blank" rel="noreferrer">Precompiled Header</a> 的一种特殊情况(内嵌在源文件中)。在打开文件的时候,它会将文件开头的几个预处理指令(被叫做 preamble构建成 PCH 缓存在磁盘上,后续在解析的时候则可以直接加载 PCH 文件,从而跳过前面几个预处理指令,这样可以大大减少要重新解析的代码量。</p><p>例如,对于如下的代码</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;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &lt;iostream&gt;</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;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::cout </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Hello world!&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::endl;</span></span>

View File

@@ -1 +1 @@
import{_ as i,c as s,o as e,ae as n}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation.md","filePath":"zh/design/compilation.md"}'),t={name:"zh/design/compilation.md"};function l(p,a,o,r,h,c){return e(),s("div",null,a[0]||(a[0]=[n("",7)]))}const m=i(t,[["render",l]]);export{k as __pageData,m as default};
import{_ as i,c as s,o as e,ae as n}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation.md","filePath":"zh/design/compilation.md"}'),t={name:"zh/design/compilation.md"};function l(p,a,o,r,h,c){return e(),s("div",null,a[0]||(a[0]=[n("",7)]))}const m=i(t,[["render",l]]);export{k as __pageData,m as default};

View File

@@ -1,4 +1,4 @@
import{_ as a,c as i,o as e,ae as n}from"./chunks/framework.U1Gow_7P.js";const r=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),p={name:"zh/design/header-context.md"};function t(l,s,c,d,h,o){return e(),i("div",null,s[0]||(s[0]=[n(`<h1 id="header-context" tabindex="-1">Header Context <a class="header-anchor" href="#header-context" aria-label="Permalink to &quot;Header Context&quot;"></a></h1><p>为了让 clangd 正常工作,用户往往需要提供一份<code>compile_commands.json</code>文件(后文简称 CDB 文件。C++ 的传统编译模型的基本编译单元是一个源文件(例如<code>.c</code>和<code>.cpp</code>文件),<code>#include</code>只是把头文件的内容粘贴复制到源文件中对应的位置。而上述 CDB 文件里面就储存了各个源文件对应编译命令当你打开一个源文件的时候clangd 会使用其在 CDB 中对应的编译命令来编译这个文件。</p><p>那很自然的就有一个疑问,如果 CDB 文件里面只有源文件的编译命令,没有头文件的,那么 clangd 是如何处理头文件的呢clangd 会把头文件当做一个源文件进行处理,然后呢,根据一些规则,比如使用对应目录下的源文件的编译命令作为该头文件的编译命令。这样的模型简单有效,但是却忽略了一些情况。</p><p>由于头文件是源文件的一部分,那么就会出现它的内容根据它在源文件中前面的内容不同而不同的情况。例如:</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>
import{_ as a,c as i,o as e,ae as n}from"./chunks/framework.D8webtH5.js";const r=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),p={name:"zh/design/header-context.md"};function t(l,s,c,d,h,o){return e(),i("div",null,s[0]||(s[0]=[n(`<h1 id="header-context" tabindex="-1">Header Context <a class="header-anchor" href="#header-context" aria-label="Permalink to &quot;Header Context&quot;"></a></h1><p>为了让 clangd 正常工作,用户往往需要提供一份<code>compile_commands.json</code>文件(后文简称 CDB 文件。C++ 的传统编译模型的基本编译单元是一个源文件(例如<code>.c</code>和<code>.cpp</code>文件),<code>#include</code>只是把头文件的内容粘贴复制到源文件中对应的位置。而上述 CDB 文件里面就储存了各个源文件对应编译命令当你打开一个源文件的时候clangd 会使用其在 CDB 中对应的编译命令来编译这个文件。</p><p>那很自然的就有一个疑问,如果 CDB 文件里面只有源文件的编译命令,没有头文件的,那么 clangd 是如何处理头文件的呢clangd 会把头文件当做一个源文件进行处理,然后呢,根据一些规则,比如使用对应目录下的源文件的编译命令作为该头文件的编译命令。这样的模型简单有效,但是却忽略了一些情况。</p><p>由于头文件是源文件的一部分,那么就会出现它的内容根据它在源文件中前面的内容不同而不同的情况。例如:</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;">#ifdef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> TEST</span></span>
<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>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#else</span></span>

View File

@@ -1 +1 @@
import{_ as a,c as i,o as e,ae as n}from"./chunks/framework.U1Gow_7P.js";const r=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),p={name:"zh/design/header-context.md"};function t(l,s,c,d,h,o){return e(),i("div",null,s[0]||(s[0]=[n("",10)]))}const g=a(p,[["render",t]]);export{r as __pageData,g as default};
import{_ as a,c as i,o as e,ae as n}from"./chunks/framework.D8webtH5.js";const r=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),p={name:"zh/design/header-context.md"};function t(l,s,c,d,h,o){return e(),i("div",null,s[0]||(s[0]=[n("",10)]))}const g=a(p,[["render",t]]);export{r as __pageData,g as default};

View File

@@ -1 +1 @@
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/index.md","filePath":"zh/design/index.md"}'),s={name:"zh/design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const h=n(s,[["render",i]]);export{f as __pageData,h as default};
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.D8webtH5.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/index.md","filePath":"zh/design/index.md"}'),s={name:"zh/design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const h=n(s,[["render",i]]);export{f as __pageData,h as default};

View File

@@ -1 +1 @@
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/index.md","filePath":"zh/design/index.md"}'),s={name:"zh/design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const h=n(s,[["render",i]]);export{f as __pageData,h as default};
import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.D8webtH5.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/index.md","filePath":"zh/design/index.md"}'),s={name:"zh/design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"")],-1)]))}const h=n(s,[["render",i]]);export{f as __pageData,h as default};

View File

@@ -1,4 +1,4 @@
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.U1Gow_7P.js";const c=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),l={name:"zh/design/template-resolver.md"};function p(n,s,h,k,d,r){return e(),a("div",null,s[0]||(s[0]=[t(`<h1 id="template-resolver" tabindex="-1">Template Resolver <a class="header-anchor" href="#template-resolver" aria-label="Permalink to &quot;Template Resolver&quot;"></a></h1><p>那首先,就是更好的模板支持,这也是我最开始想要 clangd 支持的特性。具体来说目前在处理模板上有什么问题呢?</p><p>以代码补全为例,考虑如下的代码,<code>^</code>代表光标位置:</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;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</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;">&gt;</span></span>
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.D8webtH5.js";const c=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),l={name:"zh/design/template-resolver.md"};function p(n,s,h,k,d,r){return e(),a("div",null,s[0]||(s[0]=[t(`<h1 id="template-resolver" tabindex="-1">Template Resolver <a class="header-anchor" href="#template-resolver" aria-label="Permalink to &quot;Template Resolver&quot;"></a></h1><p>那首先,就是更好的模板支持,这也是我最开始想要 clangd 支持的特性。具体来说目前在处理模板上有什么问题呢?</p><p>以代码补全为例,考虑如下的代码,<code>^</code>代表光标位置:</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;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</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;">&gt;</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:#6F42C1;--shiki-dark:#B392F0;">std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">vec</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> vec.</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">^</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p> C++ <code>vector</code><code>vector&lt;bool&gt;</code>使使 clangd <code>vector</code></p><p></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;">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &lt;</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;">&gt;</span></span>

View File

@@ -1 +1 @@
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.U1Gow_7P.js";const c=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),l={name:"zh/design/template-resolver.md"};function p(n,s,h,k,d,r){return e(),a("div",null,s[0]||(s[0]=[t("",10)]))}const E=i(l,[["render",p]]);export{c as __pageData,E as default};
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.D8webtH5.js";const c=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),l={name:"zh/design/template-resolver.md"};function p(n,s,h,k,d,r){return e(),a("div",null,s[0]||(s[0]=[t("",10)]))}const E=i(l,[["render",p]]);export{c as __pageData,E as default};

View File

@@ -1,4 +1,4 @@
import{_ as i,c as a,o as l,ae as n}from"./chunks/framework.U1Gow_7P.js";const o=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),e={name:"zh/dev/build.md"};function t(h,s,p,k,r,c){return l(),a("div",null,s[0]||(s[0]=[n(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to &quot;Build from Source&quot;"></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to &quot;Supported Platforms&quot;"></a></h2><ul><li>Windows</li><li>Linux</li><li>MacOS</li></ul><h2 id="prerequisite" tabindex="-1">Prerequisite <a class="header-anchor" href="#prerequisite" aria-label="Permalink to &quot;Prerequisite&quot;"></a></h2><p>本小节介绍编译 clice 的前置依赖。</p><h3 id="toolchain" tabindex="-1">Toolchain <a class="header-anchor" href="#toolchain" aria-label="Permalink to &quot;Toolchain&quot;"></a></h3><ul><li>clang &gt;= 19</li><li>c++23 compitable standard library <ul><li>MSVC STL &gt;= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ &gt;= 14</li><li>Clang libc++ &gt;= 20</li></ul></li></ul><p>clice 使用 C++23 作为语言标准 ,请确保有可用的 clang 19 以及以上的编译器,以及兼容 C++23 的标准库。</p><blockquote><p>clice 暂时只能使用 clang 编译,在未来我们会改进这一点,使其能使用 gcc 和 msvc 编译。</p></blockquote><h3 id="llvm-libs" tabindex="-1">LLVM Libs <a class="header-anchor" href="#llvm-libs" aria-label="Permalink to &quot;LLVM Libs&quot;"></a></h3><ul><li>20.1.5 &lt;= llvm libs &lt; 21</li></ul><p>由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST这意味它需要链接 llvm/clang libs。另外由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。</p><p>如果你能找到系统的 llvm package 对应的 llvm commit将该 commit 下的如下三个文件</p><ul><li><code>clang/lib/Sema/CoroutineStmtBuilder.h</code></li><li><code>clang/lib/Sema/TypeLocBuilder.h</code></li><li><code>clang/lib/Sema/TreeTransform.h</code></li></ul><p>拷贝到 <code>LLVM_INSTALL_PATH/include/clang/Sema/</code> 中即可。</p><p>除了这种方法以外,还有两种办法获取 clice 所需的 llvm libs</p><ol><li>使用我们提供的预编译版本</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># .github/workflows/cmake.yml</span></span>
import{_ as i,c as a,o as l,ae as n}from"./chunks/framework.D8webtH5.js";const o=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),e={name:"zh/dev/build.md"};function t(h,s,p,k,r,c){return l(),a("div",null,s[0]||(s[0]=[n(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to &quot;Build from Source&quot;"></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to &quot;Supported Platforms&quot;"></a></h2><ul><li>Windows</li><li>Linux</li><li>MacOS</li></ul><h2 id="prerequisite" tabindex="-1">Prerequisite <a class="header-anchor" href="#prerequisite" aria-label="Permalink to &quot;Prerequisite&quot;"></a></h2><p>本小节介绍编译 clice 的前置依赖。</p><h3 id="toolchain" tabindex="-1">Toolchain <a class="header-anchor" href="#toolchain" aria-label="Permalink to &quot;Toolchain&quot;"></a></h3><ul><li>clang &gt;= 19</li><li>c++23 compitable standard library <ul><li>MSVC STL &gt;= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ &gt;= 14</li><li>Clang libc++ &gt;= 20</li></ul></li></ul><p>clice 使用 C++23 作为语言标准 ,请确保有可用的 clang 19 以及以上的编译器,以及兼容 C++23 的标准库。</p><blockquote><p>clice 暂时只能使用 clang 编译,在未来我们会改进这一点,使其能使用 gcc 和 msvc 编译。</p></blockquote><h3 id="llvm-libs" tabindex="-1">LLVM Libs <a class="header-anchor" href="#llvm-libs" aria-label="Permalink to &quot;LLVM Libs&quot;"></a></h3><ul><li>20.1.5 &lt;= llvm libs &lt; 21</li></ul><p>由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST这意味它需要链接 llvm/clang libs。另外由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。</p><p>如果你能找到系统的 llvm package 对应的 llvm commit将该 commit 下的如下三个文件</p><ul><li><code>clang/lib/Sema/CoroutineStmtBuilder.h</code></li><li><code>clang/lib/Sema/TypeLocBuilder.h</code></li><li><code>clang/lib/Sema/TreeTransform.h</code></li></ul><p>拷贝到 <code>LLVM_INSTALL_PATH/include/clang/Sema/</code> 中即可。</p><p>除了这种方法以外,还有两种办法获取 clice 所需的 llvm libs</p><ol><li>使用我们提供的预编译版本</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># .github/workflows/cmake.yml</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Linux precompiled binary require glibc 2.35 (build on ubuntu 22.04)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mkdir</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./.llvm</span></span>

View File

@@ -1 +1 @@
import{_ as i,c as a,o as l,ae as n}from"./chunks/framework.U1Gow_7P.js";const o=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),e={name:"zh/dev/build.md"};function t(h,s,p,k,r,c){return l(),a("div",null,s[0]||(s[0]=[n("",46)]))}const F=i(e,[["render",t]]);export{o as __pageData,F as default};
import{_ as i,c as a,o as l,ae as n}from"./chunks/framework.D8webtH5.js";const o=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),e={name:"zh/dev/build.md"};function t(h,s,p,k,r,c){return l(),a("div",null,s[0]||(s[0]=[n("",46)]))}const F=i(e,[["render",t]]);export{o as __pageData,F as default};

View File

@@ -1 +1 @@
import{_ as e,c as a,o,ae as i}from"./chunks/framework.U1Gow_7P.js";const b=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/contribution.md","filePath":"zh/dev/contribution.md"}'),n={name:"zh/dev/contribution.md"};function r(l,t,d,c,s,u){return o(),a("div",null,t[0]||(t[0]=[i('<h1 id="contribution" tabindex="-1">Contribution <a class="header-anchor" href="#contribution" aria-label="Permalink to &quot;Contribution&quot;"></a></h1><p>我们欢迎任何贡献!</p><p>请参考 <a href="./build">build</a> 来构建 clice参考 <a href="./test-and-debug">test and debug</a> 来测试和调试 clice。</p><h2 id="code-style" tabindex="-1">Code Style <a class="header-anchor" href="#code-style" aria-label="Permalink to &quot;Code Style&quot;"></a></h2><p>命名</p><ul><li>变量名:小写下换线</li><li>类名,枚举名:大驼峰</li></ul>',6)]))}const h=e(n,[["render",r]]);export{b as __pageData,h as default};
import{_ as e,c as a,o,ae as i}from"./chunks/framework.D8webtH5.js";const b=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/contribution.md","filePath":"zh/dev/contribution.md"}'),n={name:"zh/dev/contribution.md"};function r(l,t,d,c,s,u){return o(),a("div",null,t[0]||(t[0]=[i('<h1 id="contribution" tabindex="-1">Contribution <a class="header-anchor" href="#contribution" aria-label="Permalink to &quot;Contribution&quot;"></a></h1><p>我们欢迎任何贡献!</p><p>请参考 <a href="./build">build</a> 来构建 clice参考 <a href="./test-and-debug">test and debug</a> 来测试和调试 clice。</p><h2 id="code-style" tabindex="-1">Code Style <a class="header-anchor" href="#code-style" aria-label="Permalink to &quot;Code Style&quot;"></a></h2><p>命名</p><ul><li>变量名:小写下换线</li><li>类名,枚举名:大驼峰</li></ul>',6)]))}const h=e(n,[["render",r]]);export{b as __pageData,h as default};

View File

@@ -1 +1 @@
import{_ as e,c as a,o,ae as i}from"./chunks/framework.U1Gow_7P.js";const b=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/contribution.md","filePath":"zh/dev/contribution.md"}'),n={name:"zh/dev/contribution.md"};function r(l,t,d,c,s,u){return o(),a("div",null,t[0]||(t[0]=[i("",6)]))}const h=e(n,[["render",r]]);export{b as __pageData,h as default};
import{_ as e,c as a,o,ae as i}from"./chunks/framework.D8webtH5.js";const b=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/contribution.md","filePath":"zh/dev/contribution.md"}'),n={name:"zh/dev/contribution.md"};function r(l,t,d,c,s,u){return o(),a("div",null,t[0]||(t[0]=[i("",6)]))}const h=e(n,[["render",r]]);export{b as __pageData,h as default};

View File

@@ -1,4 +1,4 @@
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.U1Gow_7P.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/test-and-debug.md","filePath":"zh/dev/test-and-debug.md"}'),l={name:"zh/dev/test-and-debug.md"};function n(p,s,h,k,d,c){return e(),a("div",null,s[0]||(s[0]=[t(`<h1 id="test-and-debug" tabindex="-1">Test and Debug <a class="header-anchor" href="#test-and-debug" aria-label="Permalink to &quot;Test and Debug&quot;"></a></h1><h2 id="run-tests" tabindex="-1">Run Tests <a class="header-anchor" href="#run-tests" aria-label="Permalink to &quot;Run Tests&quot;"></a></h2><p>clice 有两种形式的测试,单元测试和集成测试。</p><ul><li>运行单元测试</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./build/bin/unit_tests</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --test-dir=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;./tests/data&quot;</span></span></code></pre></div><ul><li>运行集成测试</li></ul><p>我们使用 pytest 来运行集成测试,请参考 <code>pyproject.toml</code> 安装依赖的 python 库</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pytest</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --log-cli-level=INFO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --executable=./build/bin/clice</span></span></code></pre></div><p>如果你使用 xmake 作为构建系统,可以直接通过 xmake 运行测试:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --verbose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> unit_tests</span></span>
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.D8webtH5.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/test-and-debug.md","filePath":"zh/dev/test-and-debug.md"}'),l={name:"zh/dev/test-and-debug.md"};function n(p,s,h,k,d,c){return e(),a("div",null,s[0]||(s[0]=[t(`<h1 id="test-and-debug" tabindex="-1">Test and Debug <a class="header-anchor" href="#test-and-debug" aria-label="Permalink to &quot;Test and Debug&quot;"></a></h1><h2 id="run-tests" tabindex="-1">Run Tests <a class="header-anchor" href="#run-tests" aria-label="Permalink to &quot;Run Tests&quot;"></a></h2><p>clice 有两种形式的测试,单元测试和集成测试。</p><ul><li>运行单元测试</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./build/bin/unit_tests</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --test-dir=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;./tests/data&quot;</span></span></code></pre></div><ul><li>运行集成测试</li></ul><p>我们使用 pytest 来运行集成测试,请参考 <code>pyproject.toml</code> 安装依赖的 python 库</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pytest</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --log-cli-level=INFO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --executable=./build/bin/clice</span></span></code></pre></div><p>如果你使用 xmake 作为构建系统,可以直接通过 xmake 运行测试:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --verbose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> unit_tests</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> test</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --verbose</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> integration_tests/default</span></span></code></pre></div><h2 id="debug" tabindex="-1">Debug <a class="header-anchor" href="#debug" aria-label="Permalink to &quot;Debug&quot;"></a></h2><p> clice socket clice clice </p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./build/bin/clice</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=socket</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --port=50051</span></span></code></pre></div><p></p><ul><li>使 pytest </li></ul><p> clice</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> pytest</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --log-cli-level=INFO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tests/integration/test_file_operation.py::test_did_open</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=socket</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --port=50051</span></span></code></pre></div><ul><li>使 vscode </li></ul><p> clice-vscode clice 使</p><ol><li><p> <a href="https://marketplace.visualstudio.com/items?itemName=ykiko.clice-vscode" target="_blank" rel="noreferrer">clice-vscode</a></p></li><li><p> <code>settings.json</code>: <code>.vscode/settings.json</code> </p><div class="language-jsonc vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">jsonc</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>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Point this to the clice binary you downloaded.</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;clice.executable&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;/path/to/your/clice/executable&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>

View File

@@ -1 +1 @@
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.U1Gow_7P.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/test-and-debug.md","filePath":"zh/dev/test-and-debug.md"}'),l={name:"zh/dev/test-and-debug.md"};function n(p,s,h,k,d,c){return e(),a("div",null,s[0]||(s[0]=[t("",22)]))}const g=i(l,[["render",n]]);export{r as __pageData,g as default};
import{_ as i,c as a,o as e,ae as t}from"./chunks/framework.D8webtH5.js";const r=JSON.parse('{"title":"Test and Debug","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/test-and-debug.md","filePath":"zh/dev/test-and-debug.md"}'),l={name:"zh/dev/test-and-debug.md"};function n(p,s,h,k,d,c){return e(),a("div",null,s[0]||(s[0]=[t("",22)]))}const g=i(l,[["render",n]]);export{r as __pageData,g as default};

View File

@@ -1 +1 @@
import{_ as e,c as o,o as d,ae as a}from"./chunks/framework.U1Gow_7P.js";const b=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/configuration.md","filePath":"zh/guide/configuration.md"}'),c={name:"zh/guide/configuration.md"};function r(i,t,l,h,u,n){return d(),o("div",null,t[0]||(t[0]=[a("",30)]))}const p=e(c,[["render",r]]);export{b as __pageData,p as default};
import{_ as e,c as o,o as d,ae as a}from"./chunks/framework.D8webtH5.js";const b=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/configuration.md","filePath":"zh/guide/configuration.md"}'),c={name:"zh/guide/configuration.md"};function r(i,t,l,h,u,n){return d(),o("div",null,t[0]||(t[0]=[a("",30)]))}const p=e(c,[["render",r]]);export{b as __pageData,p as default};

View File

@@ -1 +1 @@
import{_ as e,c as i,o as t,ae as o}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/quick-start.md","filePath":"zh/guide/quick-start.md"}'),r={name:"zh/guide/quick-start.md"};function l(s,a,c,n,d,h){return t(),i("div",null,a[0]||(a[0]=[o("",31)]))}const m=e(r,[["render",l]]);export{p as __pageData,m as default};
import{_ as e,c as i,o as t,ae as o}from"./chunks/framework.D8webtH5.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/quick-start.md","filePath":"zh/guide/quick-start.md"}'),r={name:"zh/guide/quick-start.md"};function l(s,a,c,n,d,h){return t(),i("div",null,a[0]||(a[0]=[o("",31)]))}const m=e(r,[["render",l]]);export{p as __pageData,m as default};

View File

@@ -1 +1 @@
import{_ as a,c as t,o as r,ae as c}from"./chunks/framework.U1Gow_7P.js";const u=JSON.parse('{"title":"What is clice?","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/what-is-clice.md","filePath":"zh/guide/what-is-clice.md"}'),l={name:"zh/guide/what-is-clice.md"};function s(n,e,i,o,d,g){return r(),t("div",null,e[0]||(e[0]=[c("",11)]))}const p=a(l,[["render",s]]);export{u as __pageData,p as default};
import{_ as a,c as t,o as r,ae as c}from"./chunks/framework.D8webtH5.js";const u=JSON.parse('{"title":"What is clice?","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/what-is-clice.md","filePath":"zh/guide/what-is-clice.md"}'),l={name:"zh/guide/what-is-clice.md"};function s(n,e,i,o,d,g){return r(),t("div",null,e[0]||(e[0]=[c("",11)]))}const p=a(l,[["render",s]]);export{u as __pageData,p as default};

View File

@@ -1 +1 @@
import{_ as e,c as t,o as i}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"下一代 C++ 语言服务器","tagline":"开发正在活跃进行中","actions":[{"theme":"brand","text":"什么是 clice?","link":"/zh/guide/what-is-clice"},{"theme":"alt","text":"快速开始","link":"/zh/guide/quick-start"},{"theme":"alt","text":"参与贡献","link":"/zh/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"更好的模板处理","details":"使用伪实例化器处理依赖的模板名,对于复杂模板也可以有代码补全"},{"icon":"H","title":"头文件上下文","details":"支持头文件在不同源文件的上下文之间进行状态切换,当然也完全支持非自包含文件"},{"icon":"M","title":"模块","details":"良好的 C++20 模块支持,从代码补全到高亮到跳转全都适配"},{"icon":"I","title":"内存占用更低,速度更快","details":"优秀的异步任务调度,支持编译任务取消,缓存必要的信息,避免无意义的 CPU 浪费"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,l,o,s,r,d){return i(),t("div")}const p=e(a,[["render",n]]);export{m as __pageData,p as default};
import{_ as e,c as t,o as i}from"./chunks/framework.D8webtH5.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"下一代 C++ 语言服务器","tagline":"开发正在活跃进行中","actions":[{"theme":"brand","text":"什么是 clice?","link":"/zh/guide/what-is-clice"},{"theme":"alt","text":"快速开始","link":"/zh/guide/quick-start"},{"theme":"alt","text":"参与贡献","link":"/zh/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"更好的模板处理","details":"使用伪实例化器处理依赖的模板名,对于复杂模板也可以有代码补全"},{"icon":"H","title":"头文件上下文","details":"支持头文件在不同源文件的上下文之间进行状态切换,当然也完全支持非自包含文件"},{"icon":"M","title":"模块","details":"良好的 C++20 模块支持,从代码补全到高亮到跳转全都适配"},{"icon":"I","title":"内存占用更低,速度更快","details":"优秀的异步任务调度,支持编译任务取消,缓存必要的信息,避免无意义的 CPU 浪费"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,l,o,s,r,d){return i(),t("div")}const p=e(a,[["render",n]]);export{m as __pageData,p as default};

View File

@@ -1 +1 @@
import{_ as e,c as t,o as i}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"下一代 C++ 语言服务器","tagline":"开发正在活跃进行中","actions":[{"theme":"brand","text":"什么是 clice?","link":"/zh/guide/what-is-clice"},{"theme":"alt","text":"快速开始","link":"/zh/guide/quick-start"},{"theme":"alt","text":"参与贡献","link":"/zh/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"更好的模板处理","details":"使用伪实例化器处理依赖的模板名,对于复杂模板也可以有代码补全"},{"icon":"H","title":"头文件上下文","details":"支持头文件在不同源文件的上下文之间进行状态切换,当然也完全支持非自包含文件"},{"icon":"M","title":"模块","details":"良好的 C++20 模块支持,从代码补全到高亮到跳转全都适配"},{"icon":"I","title":"内存占用更低,速度更快","details":"优秀的异步任务调度,支持编译任务取消,缓存必要的信息,避免无意义的 CPU 浪费"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,l,o,s,r,d){return i(),t("div")}const p=e(a,[["render",n]]);export{m as __pageData,p as default};
import{_ as e,c as t,o as i}from"./chunks/framework.D8webtH5.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"clice","text":"下一代 C++ 语言服务器","tagline":"开发正在活跃进行中","actions":[{"theme":"brand","text":"什么是 clice?","link":"/zh/guide/what-is-clice"},{"theme":"alt","text":"快速开始","link":"/zh/guide/quick-start"},{"theme":"alt","text":"参与贡献","link":"/zh/dev/contribution"}],"image":{"src":"/image.png","alt":"clice"}},"features":[{"icon":"T","title":"更好的模板处理","details":"使用伪实例化器处理依赖的模板名,对于复杂模板也可以有代码补全"},{"icon":"H","title":"头文件上下文","details":"支持头文件在不同源文件的上下文之间进行状态切换,当然也完全支持非自包含文件"},{"icon":"M","title":"模块","details":"良好的 C++20 模块支持,从代码补全到高亮到跳转全都适配"},{"icon":"I","title":"内存占用更低,速度更快","details":"优秀的异步任务调度,支持编译任务取消,缓存必要的信息,避免无意义的 CPU 浪费"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,l,o,s,r,d){return i(),t("div")}const p=e(a,[["render",n]]);export{m as __pageData,p as default};

File diff suppressed because one or more lines are too long

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Compilation | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/design_compilation.md.DgqTpBDl.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/design_compilation.md.CCvAsCts.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>
@@ -23,7 +23,7 @@
<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;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::cout </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Hello world!&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::endl;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>The <code>iostream</code> header file has about 20,000 lines of code. clice will first build the line <code>#include &lt;iostream&gt;</code> into a PCH file, and after completion, use this PCH file to parse the subsequent code. This way, the amount of code that needs to be re-parsed later is reduced to just 5 lines instead of the original 20,000 lines, making it very fast. Unless you modify the code in the preamble section, which requires building a new preamble.</p><h2 id="cancel-compilation" tabindex="-1">Cancel Compilation <a class="header-anchor" href="#cancel-compilation" aria-label="Permalink to &quot;Cancel Compilation&quot;"></a></h2></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><a class="VPLink link pager-link prev" href="/design/architecture" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Architecture</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/design/header-context" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Header Context</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Header Context | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/design_header-context.md.EUdQ-Lzo.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/design_header-context.md.BxMpdImS.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>
@@ -38,7 +38,7 @@
<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;">struct</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 style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;a.h&quot;</span></span></code></pre></div><p><code>a.h</code> itself cannot be compiled, but when embedded in <code>b.cpp</code>, it compiles normally. In this case, clangd will report an error in <code>a.h</code>, unable to find the definition of <code>X</code>. Obviously, this is because it treats <code>a.h</code> as an independent source file. There are many such header files in libstdc++ code, and some popular C++ header-only libraries also have such code, which clangd currently cannot handle.</p><p>clice will support <strong>header context</strong>, supporting automatic and user-initiated switching of header file states, and of course will also support non-self-contained header files. We want to achieve the following effect, using the first piece of code as an example. When you jump from <code>b.cpp</code> to <code>a.h</code>, use <code>b.cpp</code> as the context for <code>a.h</code>. Similarly, when you jump from <code>c.cpp</code> to <code>a.h</code>, use <code>c.cpp</code> as the context for <code>a.h</code>.</p></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><a class="VPLink link pager-link prev" href="/design/compilation" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Compilation</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/design/template-resolver" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Template Resolver</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Template Resolver | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/design_template-resolver.md.IYEsm7Dh.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/design_template-resolver.md.BWRB2TFl.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>
@@ -25,7 +25,7 @@
<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:#6F42C1;--shiki-dark:#B392F0;">std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;&gt; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">vec2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> vec2[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">].</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">^</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>From the user&#39;s perspective, completion should also be provided here, since the type of <code>vec2[0]</code> is also <code>vector&lt;T&gt;</code>, right? Same as the previous example. But clangd won&#39;t provide any completion here. What&#39;s the problem? According to the C++ standard, the return type of <code>std::vector&lt;T&gt;::operator[]</code> is <code>std::vector&lt;T&gt;::reference</code>, which is actually a <a href="https://en.cppreference.com/w/cpp/language/dependent_name" target="_blank" rel="noreferrer">dependent name</a>. Its result seems quite direct - it&#39;s <code>T&amp;</code>. But in libstdc++, its definition is nested in dozens of layers of templates, seemingly for compatibility with old standards? So why can&#39;t clangd handle this situation?</p><ol><li>It&#39;s based on primary template assumptions, not considering that partial specializations might make lookup impossible to proceed</li><li>It only performs name lookup without template instantiation, so even if it finds the final result, it can&#39;t map it back to the original template parameters</li><li>It doesn&#39;t consider default template parameters, unable to handle dependent names caused by default template parameters</li></ol><p>Although we can make exceptions for standard library types to provide related support, I hope that user code can have the same status as standard library code, so we need a universal algorithm to handle dependent types. To solve this problem, I wrote a pseudo-instantiation (pseudo instantiator). It can instantiate dependent types without specific types, achieving the purpose of simplification. For example, in the above example, <code>std::vector&lt;std::vector&lt;T&gt;&gt;::reference</code> can be simplified to <code>std::vector&lt;T&gt;&amp;</code>, and further provide code completion options for users.</p></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><a class="VPLink link pager-link prev" href="/design/header-context" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Header Context</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/dev/build" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Build from Source</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Build from Source | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/dev_build.md.BPdhy5jH.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/dev_build.md.CU4aDhpP.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>
@@ -44,7 +44,7 @@
<span class="line"><span>├── lib</span></span>
<span class="line"><span>├── LICENSE</span></span>
<span class="line"><span>├── README.md</span></span></code></pre></div><p>Hint: launch clice in the docker container by running the following command:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --rm</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -it</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --entrypoint</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bash</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice</span></span></code></pre></div></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><a class="VPLink link pager-link prev" href="/design/template-resolver" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Template Resolver</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/dev/contribution" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Contribution</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Test and Debug | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/dev_test-and-debug.md.B85mthGc.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/dev_test-and-debug.md.BDhcoSZa.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>
@@ -32,7 +32,7 @@
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></li><li><p>Reload Window: After modifying the configuration, execute the <code>Developer: Reload Window</code> command in VS Code for the settings to take effect. The extension will automatically connect to the clice instance listening on port 50051.</p></li></ol><p>If you need to modify or debug the clice-vscode extension itself, follow these steps:</p><ol><li><p>Clone and install dependencies:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/clice-io/clice-vscode</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice-vscode</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span></span></code></pre></div></li><li><p>Open the extension project with VS Code: Open the <code>clice-vscode</code> folder in a new VS Code window.</p></li><li><p>Create debug configuration: In the <code>clice-vscode</code> project, also create a <code>.vscode/settings.json</code> file with the same content as above.</p></li><li><p>Press <code>F5</code>. This will launch an [Extension Development Host] window. This is a new VS Code window with your local clice-vscode extension code loaded. Open your C++ project in this new window, and it should automatically connect to clice.</p></li></ol></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><a class="VPLink link pager-link prev" href="/dev/contribution" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Contribution</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/guide/configuration" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Configuration</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"design_architecture.md":"D8TKjkhM","design_compilation.md":"DgqTpBDl","design_header-context.md":"EUdQ-Lzo","design_index.md":"BgicbTS7","design_template-resolver.md":"IYEsm7Dh","dev_build.md":"BPdhy5jH","dev_contribution.md":"C0y1pn0v","dev_test-and-debug.md":"B85mthGc","guide_configuration.md":"BSfrI2TP","guide_quick-start.md":"DrPBamDw","guide_what-is-clice.md":"q1sqlvBr","index.md":"B80amafG","zh_design_architecture.md":"BVcDWyLW","zh_design_compilation.md":"DfE77o6C","zh_design_header-context.md":"BZN78X54","zh_design_index.md":"DHNbht8F","zh_design_template-resolver.md":"BdV6FoQY","zh_dev_build.md":"TwBXt4g8","zh_dev_contribution.md":"Dh-sErND","zh_dev_test-and-debug.md":"C2WjDAQj","zh_guide_configuration.md":"BnQR4J3z","zh_guide_quick-start.md":"DXlUe3jK","zh_guide_what-is-clice.md":"DFkS8WKr","zh_index.md":"DOAh-Isq"}
{"design_architecture.md":"B1nOS2BF","design_compilation.md":"CCvAsCts","design_header-context.md":"BxMpdImS","design_index.md":"iLhzg_qd","design_template-resolver.md":"BWRB2TFl","dev_build.md":"CU4aDhpP","dev_contribution.md":"BDlGKyx4","dev_test-and-debug.md":"BDhcoSZa","guide_configuration.md":"CnUx2q8U","guide_quick-start.md":"GKsihDbV","guide_what-is-clice.md":"BMyw_-9E","index.md":"JdQy7MpZ","zh_design_architecture.md":"BVGXXj2L","zh_design_compilation.md":"BpkOwlT8","zh_design_header-context.md":"6ANkDXaY","zh_design_index.md":"CRxI2HZv","zh_design_template-resolver.md":"C8xOYUnS","zh_dev_build.md":"DT8nwjoU","zh_dev_contribution.md":"DouHFQDZ","zh_dev_test-and-debug.md":"CECWy0Lv","zh_guide_configuration.md":"DQliZFQh","zh_guide_quick-start.md":"BIzdzWD6","zh_guide_what-is-clice.md":"D_fcfWi8","zh_index.md":"DZmqz5yo"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Compilation | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/zh_design_compilation.md.DfE77o6C.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/zh_design_compilation.md.BpkOwlT8.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>
@@ -23,7 +23,7 @@
<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;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::cout </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;Hello world!&quot;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::endl;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>iostream</code> 这个头文件大概有 2w 行代码clice 会先把 <code>#include &lt;iostream&gt;</code> 这一行代码构建成 PCH 文件,在完成之后在使用这个 PCH 文件来解析后面的代码。这样的话后续重新解析的代码量就只剩 5 行了,而不是原本的 2w 行,速度会变得非常快。除非你修改了 preamble 部分的代码,导致需要构建新的 preamble。</p><h2 id="cancel-compilation" tabindex="-1">Cancel Compilation <a class="header-anchor" href="#cancel-compilation" aria-label="Permalink to &quot;Cancel Compilation&quot;"></a></h2></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><a class="VPLink link pager-link prev" href="/zh/design/architecture" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Architecture</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/zh/design/header-context" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Header Context</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Header Context | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/zh_design_header-context.md.BZN78X54.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/zh_design_header-context.md.6ANkDXaY.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>
@@ -38,7 +38,7 @@
<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;">struct</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 style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;a.h&quot;</span></span></code></pre></div><p><code>a.h</code>自身不能被编译,但是嵌入到<code>b.cpp</code>中的时候就编译正常了。这种情况下 clangd 会在<code>a.h</code>中报错,找不到<code>X</code>的定义。显然这是因为它把<code>a.h</code>当成一个独立的源文件了。在 libstdc++ 中的代码中就有很多这样的头文件,现在流行的一些 C++ 的 header-only 的库也有些有这样的代码clangd 目前无法处理它们。</p><p>clice 将会支持<strong>头文件上下文 (header context)</strong>,支持自动和用户主动切换头文件的状态,当然也会支持非自包含的头文件。我们想要实现如下的效果,以最开始那份代码为例。当你从<code>b.cpp</code>跳转到<code>a.h</code>的时候使用<code>b.cpp</code>作为<code>a.h</code>的上下文。同理,当你从<code>c.cpp</code>跳转到<code>a.h</code>的时候则使用<code>c.cpp</code>作为<code>a.h</code>的上下文。</p></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><a class="VPLink link pager-link prev" href="/zh/design/compilation" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Compilation</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/zh/design/template-resolver" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Template Resolver</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Template Resolver | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/zh_design_template-resolver.md.BdV6FoQY.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/zh_design_template-resolver.md.C8xOYUnS.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>
@@ -25,7 +25,7 @@
<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:#6F42C1;--shiki-dark:#B392F0;">std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">std</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&lt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&gt;&gt; </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">vec2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> vec2[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">].</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">^</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>从用户的角度来说,这里也应该提供补全,毕竟<code>vec2[0]</code>的类型不也是<code>vector&lt;T&gt;</code>吗?和前面一个例子一样。但是 clangd 在这里却不会为你提供任何补全,问题出在哪里?根据 C++ 标准,<code>std::vector&lt;T&gt;</code><code>operator[]</code>返回的类型是<code>std::vector&lt;T&gt;::reference</code>,这其实是一个 <a href="https://en.cppreference.com/w/cpp/language/dependent_name" target="_blank" rel="noreferrer">dependent name</a>,它的结果似乎相当直接,就是<code>T&amp;</code>。但是 libstdc++ 中它的定义却嵌套了十几层模板,似乎是为了兼容旧标准?那为什么 clangd 不能处理这种情况呢?</p><ol><li>它基于主模板假设,不考虑偏特化可能会使查找无法进行下去</li><li>它只进行名称查找而不进行模板实例化,就算找到了最后的结果,也没法把它和最初的模板参数映射起来</li><li>不考虑默认模板参数,无法处理由默认模板参数导致的依赖名</li></ol><p>尽管我们可以对标准库的类型开洞来提供相关的支持但是我希望用户的代码能和标准库的代码有相同的地位那么我们就需要一种通用的算法来处理依赖类型。为了解决这个问题我编写了一个伪实例化器pseudo instantiator。它能在没有具体类型的前提下对依赖类型进行实例化从而达到化简的目的。比如上面这个例子里面的<code>std::vector&lt;std::vector&lt;T&gt;&gt;::reference</code>就能被化简为<code>std::vector&lt;T&gt;&amp;</code>,进一步就能为用户提供代码补全选项。</p></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><a class="VPLink link pager-link prev" href="/zh/design/header-context" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Header Context</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/zh/dev/build" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Build from Source</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Build from Source | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/zh_dev_build.md.TwBXt4g8.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/zh_dev_build.md.DT8nwjoU.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>
@@ -44,7 +44,7 @@
<span class="line"><span>├── lib</span></span>
<span class="line"><span>├── LICENSE</span></span>
<span class="line"><span>├── README.md</span></span></code></pre></div><p>提示:可以使用以下命令进入 clice 容器:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --rm</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -it</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --entrypoint</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bash</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice</span></span></code></pre></div></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><a class="VPLink link pager-link prev" href="/zh/design/template-resolver" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Template Resolver</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/zh/dev/contribution" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Contribution</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -5,15 +5,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Test and Debug | clice</title>
<meta name="description" content="a powerful and modern C++ language server">
<meta name="generator" content="VitePress v1.6.3">
<meta name="generator" content="VitePress v1.6.4">
<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>
<script type="module" src="/assets/app.7KCFXIFk.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/zh_dev_test-and-debug.md.C2WjDAQj.lean.js">
<link rel="modulepreload" href="/assets/chunks/theme.rf236kCY.js">
<link rel="modulepreload" href="/assets/chunks/framework.D8webtH5.js">
<link rel="modulepreload" href="/assets/zh_dev_test-and-debug.md.CECWy0Lv.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>
@@ -32,7 +32,7 @@
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></li><li><p>重新加载窗口:修改配置后,在 vscode 中执行 Developer: Reload Window 命令使配置生效。插件会自动连接到正在 50051 端口监听的 clice。</p></li></ol><p>如果你需要修改或调试 clice-vscode 插件本身,可以按以下步骤操作:</p><ol><li><p>克隆并安装依赖:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/clice-io/clice-vscode</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice-vscode</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span></span></code></pre></div></li><li><p>使用 vscode 打开插件项目:用一个新的 vscode 窗口打开 clice-vscode 文件夹</p></li><li><p>创建调试配置:在 clice-vscode 项目中,也创建一个 <code>.vscode/settings.json</code> 文件,内容与上方相同</p></li><li><p>按下 <code>F5</code> 键。这会启动一个【扩展开发宿主】窗口。这是一个加载了你本地 clice-vscode 插件代码的新的 vscode 窗口,在这个新窗口中打开你的 C++ 项目,它应该会自动连接到 clice</p></li></ol></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><a class="VPLink link pager-link prev" href="/zh/dev/contribution" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>Contribution</span><!--]--></a></div><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link next" href="/zh/guide/configuration" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Next page</span><span class="title" data-v-1bcd8184>Configuration</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"D8TKjkhM\",\"design_compilation.md\":\"DgqTpBDl\",\"design_header-context.md\":\"EUdQ-Lzo\",\"design_index.md\":\"BgicbTS7\",\"design_template-resolver.md\":\"IYEsm7Dh\",\"dev_build.md\":\"BPdhy5jH\",\"dev_contribution.md\":\"C0y1pn0v\",\"dev_test-and-debug.md\":\"B85mthGc\",\"guide_configuration.md\":\"BSfrI2TP\",\"guide_quick-start.md\":\"DrPBamDw\",\"guide_what-is-clice.md\":\"q1sqlvBr\",\"index.md\":\"B80amafG\",\"zh_design_architecture.md\":\"BVcDWyLW\",\"zh_design_compilation.md\":\"DfE77o6C\",\"zh_design_header-context.md\":\"BZN78X54\",\"zh_design_index.md\":\"DHNbht8F\",\"zh_design_template-resolver.md\":\"BdV6FoQY\",\"zh_dev_build.md\":\"TwBXt4g8\",\"zh_dev_contribution.md\":\"Dh-sErND\",\"zh_dev_test-and-debug.md\":\"C2WjDAQj\",\"zh_guide_configuration.md\":\"BnQR4J3z\",\"zh_guide_quick-start.md\":\"DXlUe3jK\",\"zh_guide_what-is-clice.md\":\"DFkS8WKr\",\"zh_index.md\":\"DOAh-Isq\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"design_architecture.md\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"CU4aDhpP\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"CnUx2q8U\",\"guide_quick-start.md\":\"GKsihDbV\",\"guide_what-is-clice.md\":\"BMyw_-9E\",\"index.md\":\"JdQy7MpZ\",\"zh_design_architecture.md\":\"BVGXXj2L\",\"zh_design_compilation.md\":\"BpkOwlT8\",\"zh_design_header-context.md\":\"6ANkDXaY\",\"zh_design_index.md\":\"CRxI2HZv\",\"zh_design_template-resolver.md\":\"C8xOYUnS\",\"zh_dev_build.md\":\"DT8nwjoU\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"DQliZFQh\",\"zh_guide_quick-start.md\":\"BIzdzWD6\",\"zh_guide_what-is-clice.md\":\"D_fcfWi8\",\"zh_index.md\":\"DZmqz5yo\"}");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\":\"/\"}],\"sidebar\":{\"/zh/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/zh/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/zh/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/zh/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/zh/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/zh/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/zh/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/zh/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/zh/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/zh/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/zh/guide/what-is-clice\"}]}],\"/\":[{\"text\":\"Design\",\"collapsed\":false,\"items\":[{\"text\":\"Architecture\",\"link\":\"/design/architecture\"},{\"text\":\"Compilation\",\"link\":\"/design/compilation\"},{\"text\":\"Header Context\",\"link\":\"/design/header-context\"},{\"text\":\"Template Resolver\",\"link\":\"/design/template-resolver\"}]},{\"text\":\"Development\",\"collapsed\":false,\"items\":[{\"text\":\"Build from Source\",\"link\":\"/dev/build\"},{\"text\":\"Contribution\",\"link\":\"/dev/contribution\"},{\"text\":\"Test and Debug\",\"link\":\"/dev/test-and-debug\"}]},{\"text\":\"Guide\",\"collapsed\":false,\"items\":[{\"text\":\"Configuration\",\"link\":\"/guide/configuration\"},{\"text\":\"Quick Start\",\"link\":\"/guide/quick-start\"},{\"text\":\"What is clice?\",\"link\":\"/guide/what-is-clice\"}]}]},\"socialLinks\":[{\"icon\":\"discord\",\"link\":\"https://discord.gg/PA3UxW2VA3\"},{\"icon\":\"github\",\"link\":\"https://github.com/clice-io/clice\"}],\"outline\":\"deep\"},\"locales\":{\"root\":{\"label\":\"English\"},\"zh\":{\"label\":\"简体中文\"}},\"scrollOffset\":134,\"cleanUrls\":true}");</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long