deploy: 4a2a6aa65a
This commit is contained in:
2
404.html
2
404.html
@@ -16,7 +16,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<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\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
@@ -1,36 +0,0 @@
|
||||
import{_ as i,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,s,p,r,k,o){return l(),a("div",null,s[0]||(s[0]=[e(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to "Build from Source""></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to "Supported Platforms""></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 "Prerequisites""></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 "Toolchain""></a></h3><ul><li>clang >= 19</li><li>c++23 compatible standard library <ul><li>MSVC STL >= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ >= 14</li><li>Clang libc++ >= 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 "LLVM Libs""></a></h3><ul><li>20.1.5 <= llvm libs < 21</li></ul><p>Due to the complexity of C++ syntax, writing a new parser from scratch is unrealistic. clice calls clang's API to parse C++ source files and obtain AST, which means it needs to link llvm/clang libs. Additionally, since clice uses clang's private headers, these private headers are not available in llvm's binary release, so you cannot directly use the system's llvm package.</p><p>If you can find the llvm commit corresponding to your system'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>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://github.com/clice-io/llvm-binary/releases/download/20.1.5/x86_64-linux-gnu-release.tar.xz"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -xJ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -C</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./.llvm</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># MacOS precompiled binary require macos15+</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>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://github.com/clice-io/llvm-binary/releases/download/20.1.5/arm64-macosx-apple-release.tar.xz"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -xJ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -C</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./.llvm</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Windows precompiled binary only MD runtime support</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -O</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://github.com/clice-io/llvm-binary/releases/download/20.1.5/x64-windows-msvc-release.7z"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 7z</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x64-windows-msvc-release.7z</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "-o.llvm"</span></span></code></pre></div><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>For debug versions of llvm libs, we enabled address sanitizer during build, and address sanitizer depends on compiler rt, which is very sensitive to compiler versions. So if using debug versions, please ensure your clang's compiler rt version is <strong>strictly consistent</strong> with what we used during build.</p><ul><li>Windows currently has no debug build of llvm libs because it doesn't support building clang as a dynamic library. Related progress can be found <a href="https://discourse.llvm.org/t/llvm-is-buildable-as-a-windows-dll/87748" target="_blank" rel="noreferrer">here</a></li><li>Linux uses clang20</li><li>MacOS uses homebrew llvm@20, definitely don't use apple clang</li></ul></div><ol start="2"><li>Compile llvm/clang from scratch</li></ol><p>This is the most recommended approach, ensuring environment consistency and avoiding crash issues caused by ABI inconsistencies. We provide a script for building the llvm libs required by clice: <a href="https://github.com/clice-io/clice/blob/main/scripts/build-llvm-libs.py" target="_blank" rel="noreferrer">build-llvm-libs.py</a>.</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;"> cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> llvm-project</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python3</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">clic</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/scripts/build-llvm-libs.py</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> debug</span></span></code></pre></div><p>You can also refer to llvm's official build tutorial <a href="https://llvm.org/docs/CMake.html" target="_blank" rel="noreferrer">Building LLVM with CMake</a>.</p><h3 id="gcc-toolchain" tabindex="-1">GCC Toolchain <a class="header-anchor" href="#gcc-toolchain" aria-label="Permalink to "GCC Toolchain""></a></h3><p>clice requires GCC libstdc++ >= 14. You could use a different GCC toolchain and also link statically against its libstdc++:</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;">cmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ..</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_C_FLAGS=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"--gcc-toolchain=/usr/local/gcc-14.3.0/"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_CXX_FLAGS=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"--gcc-toolchain=/usr/local/gcc-14.3.0/"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_EXE_LINKER_FLAGS=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"-static-libgcc -static-libstdc++"</span></span></code></pre></div><h2 id="building" tabindex="-1">Building <a class="header-anchor" href="#building" aria-label="Permalink to "Building""></a></h2><p>After handling the prerequisites, you can start building clice. We provide two build methods: cmake/xmake.</p><h3 id="cmake" tabindex="-1">CMake <a class="header-anchor" href="#cmake" aria-label="Permalink to "CMake""></a></h3><p>Below are the cmake parameters supported by clice:</p><ul><li><code>LLVM_INSTALL_PATH</code> specifies the installation path of llvm libs</li><li><code>CLICE_ENABLE_TEST</code> whether to build clice's unit tests</li></ul><p>For example:</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;"> cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -B</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -G</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Ninja</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_BUILD_TYPE=Debug</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DLLVM_INSTALL_PATH=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"./.llvm"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCLICE_ENABLE_TEST=ON</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_C_COMPILER=clang</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_CXX_COMPILER=clang++</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span></span></code></pre></div><h3 id="xmake" tabindex="-1">Xmake <a class="header-anchor" href="#xmake" aria-label="Permalink to "Xmake""></a></h3><p>Use the following command to build 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;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> f</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev=true</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=debug</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --toolchain=clang</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --llvm=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"./.llvm"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --enable_test=true</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;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --all</span></span></code></pre></div><blockquote><p>--llvm is optional. If not specified, xmake will automatically download our precompiled binary</p></blockquote><h2 id="building-docker-image" tabindex="-1">Building Docker Image <a class="header-anchor" href="#building-docker-image" aria-label="Permalink to "Building Docker Image""></a></h2><p>Use the following command to build docker image:</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;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -t</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span></code></pre></div><p>Run docker image 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:#032F62;--shiki-dark:#9ECBFF;"> clice</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --help</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">OVERVIEW:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> is</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> a</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> new</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> generation</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> of</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> language</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> server</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> for</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> C/C++</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span></span></code></pre></div><p>The directory structure of the docker image is as follows:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/opt/clice</span></span>
|
||||
<span class="line"><span>├── bin</span></span>
|
||||
<span class="line"><span>│ ├── clice -> /usr/local/bin/clice</span></span>
|
||||
<span class="line"><span>├── include</span></span>
|
||||
<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><h2 id="development-container" tabindex="-1">Development Container <a class="header-anchor" href="#development-container" aria-label="Permalink to "Development Container""></a></h2><p>We provide Docker images as a pre-configured environment to streamline the setup process. You can use the following scripts to manage the development container. These scripts can be run from the project root directory.</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:#6A737D;--shiki-dark:#6A737D;"># Build the development image</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./docker/linux/build.sh</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Run the container with the clang toolchain</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./docker/linux/run.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --compiler</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clang</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Run the container with the gcc toolchain</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./docker/linux/run.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --compiler</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Reset the container (stops and removes the existing one)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./docker/linux/run.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --reset</span></span></code></pre></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p>This feature is currently in a preview stage and only supports Linux. Windows support will be provided in the future, and the functionality may be subject to change.</p></div>`,50)]))}const F=i(n,[["render",t]]);export{c as __pageData,F as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as i,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,s,p,r,k,o){return l(),a("div",null,s[0]||(s[0]=[e("",50)]))}const F=i(n,[["render",t]]);export{c as __pageData,F as default};
|
||||
4
assets/dev_build.md.pZgZRssl.js
Normal file
4
assets/dev_build.md.pZgZRssl.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import{_ as t,c as l,o as i,ae as a}from"./chunks/framework.D8webtH5.js";const u=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"dev/build.md","filePath":"en/dev/build.md"}'),s={name:"dev/build.md"};function n(r,e,o,d,h,c){return i(),l("div",null,e[0]||(e[0]=[a(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to "Build from Source""></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to "Supported Platforms""></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 "Prerequisite""></a></h2><ul><li>cmake/xmake</li><li>clang, lld >= 20</li><li>c++23 <strong>compatible</strong> standard library <ul><li>MSVC STL >= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ >= 14</li><li>Clang libc++ >= 20</li></ul></li></ul><p>clice uses C++23 as its language standard. Please ensure you have a clang 20 (or higher) compiler and a C++23 compatible standard library available. clice depends on lld as its linker. Please ensure your clang toolchain can find it (clang distributions usually bundle lld, or you may need to install the lld-20 package separately).</p><blockquote><p>clice is currently only guaranteed to compile with clang (as ensured by CI testing). We do our best to maintain compatibility with gcc and msvc, but we do not add corresponding tests in CI. Contributions are welcome if you encounter any issues.</p></blockquote><h2 id="cmake" tabindex="-1">CMake <a class="header-anchor" href="#cmake" aria-label="Permalink to "CMake""></a></h2><p>Use the following commands to build 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;">cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -B</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_BUILD_TYPE=RelWithDebInfo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_C_COMPILER=clang</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_CXX_COMPILER=clang++</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span></span></code></pre></div><p>Optional build options:</p><table tabindex="0"><thead><tr><th style="text-align:left;">Option</th><th style="text-align:left;">Default</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;">LLVM_INSTALL_PATH</td><td style="text-align:left;">""</td><td style="text-align:left;">Build clice using llvm libs from a custom path</td></tr><tr><td style="text-align:left;">CLICE_ENABLE_TEST</td><td style="text-align:left;">OFF</td><td style="text-align:left;">Whether to build clice's unit tests</td></tr><tr><td style="text-align:left;">CLICE_USE_LIBCXX</td><td style="text-align:left;">OFF</td><td style="text-align:left;">Whether to build clice with libc++ (adds <code>-std=libc++</code>). If enabled, ensure that the llvm libs were also compiled with libc++.</td></tr><tr><td style="text-align:left;">CLICE_CI_ENVIRONMENT</td><td style="text-align:left;">OFF</td><td style="text-align:left;">Whether to enable the <code>CLICE_CI_ENVIRONMENT</code> macro. Some tests only run in a CI environment.</td></tr></tbody></table><h2 id="xmake" tabindex="-1">XMake <a class="header-anchor" href="#xmake" aria-label="Permalink to "XMake""></a></h2><p>Use the following commands to build 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;">xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> f</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=releasedbg</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --toolchain=clang</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --all</span></span></code></pre></div><p>Optional build options:</p><table tabindex="0"><thead><tr><th style="text-align:left;">Option</th><th style="text-align:left;">Default</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;">--llvm</td><td style="text-align:left;">""</td><td style="text-align:left;">Build clice using llvm libs from a custom path</td></tr><tr><td style="text-align:left;">--enable_test</td><td style="text-align:left;">false</td><td style="text-align:left;">Whether to build clice's unit tests</td></tr><tr><td style="text-align:left;">--ci</td><td style="text-align:left;">false</td><td style="text-align:left;">Whether to enable <code>CLICE_CI_ENVIRONMENT</code></td></tr></tbody></table><h2 id="a-note-on-llvm-libs" tabindex="-1">A Note on LLVM Libs <a class="header-anchor" href="#a-note-on-llvm-libs" aria-label="Permalink to "A Note on LLVM Libs""></a></h2><p>Due to the complexity of C++ syntax, writing a new parser from scratch is unrealistic. clice calls clang's APIs to parse C++ source files and obtain the AST, which means it needs to link against llvm/clang libs. Because clice uses clang's private headers, which are not included in the binary releases published by LLVM, you cannot use the system's llvm package directly.</p><ol><li>We publish pre-compiled binaries for the LLVM version we use on <a href="https://github.com/clice-io/clice-llvm/releases" target="_blank" rel="noreferrer">clice-llvm</a>, which are used for CI or release builds. By default, cmake and xmake will download and use the llvm libs from here during the build.</li></ol><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>For debug builds of llvm libs, we enable address sanitizer. Address sanitizer depends on compiler-rt, which is highly sensitive to the compiler version.</p><p>Therefore, if you use a debug build, please ensure your clang's compiler-rt version is <strong>strictly identical</strong> to the one used in our build.</p><ul><li>Windows does not currently have debug builds for llvm libs, as it does not support building clang as a dynamic library. Related progress is tracked <a href="https://github.com/clice-io/clice/issues/42" target="_blank" rel="noreferrer">here</a>.</li><li>Linux uses clang20</li><li>MacOS uses homebrew llvm@20. <strong>Do not use apple clang</strong>.</li></ul><p>You can refer to the <a href="https://github.com/clice-io/clice/blob/main/.github/workflows/cmake.yml" target="_blank" rel="noreferrer">cmake</a> and <a href="https://github.com/clice-io/clice/blob/main/.github/workflows/xmake.yml" target="_blank" rel="noreferrer">xmake</a> files in our CI as a reference, as they maintain an environment strictly consistent with the pre-compiled llvm libs.</p></div><ol start="2"><li>Build llvm/clang yourself to match your current environment. If the default pre-compiled binaries (Method 1) fail to run on your system due to ABI or library version (e.g., glibc) incompatibility, or if you need a custom Debug build, we recommend you use this method to compile llvm libs from scratch. We provide a script to build the llvm libs required by clice: <a href="https://github.com/clice-io/clice/blob/main/scripts/build-llvm-libs.py" target="_blank" rel="noreferrer">build-llvm-libs.py</a>.</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:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> llvm-project</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">python3</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">clic</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/scripts/build-llvm-libs.py</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> debug</span></span></code></pre></div><p>You can also refer to LLVM's official build tutorial: <a href="https://llvm.org/docs/CMake.html" target="_blank" rel="noreferrer">Building LLVM with CMake</a>.</p>`,24)]))}const b=t(s,[["render",n]]);export{u as __pageData,b as default};
|
||||
1
assets/dev_build.md.pZgZRssl.lean.js
Normal file
1
assets/dev_build.md.pZgZRssl.lean.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as t,c as l,o as i,ae as a}from"./chunks/framework.D8webtH5.js";const u=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"dev/build.md","filePath":"en/dev/build.md"}'),s={name:"dev/build.md"};function n(r,e,o,d,h,c){return i(),l("div",null,e[0]||(e[0]=[a("",24)]))}const b=t(s,[["render",n]]);export{u as __pageData,b as default};
|
||||
4
assets/zh_dev_build.md.C5-ImQeZ.js
Normal file
4
assets/zh_dev_build.md.C5-ImQeZ.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import{_ as i,c as a,o as t,ae as e}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),s={name:"zh/dev/build.md"};function r(d,l,n,h,c,o){return t(),a("div",null,l[0]||(l[0]=[e(`<h1 id="build-from-source" tabindex="-1">Build from Source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to "Build from Source""></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to "Supported Platforms""></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 "Prerequisite""></a></h2><ul><li>cmake/xmake</li><li>clang, lld >= 20</li><li>c++23 <strong>compatible</strong> standard library <ul><li>MSVC STL >= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ >= 14</li><li>Clang libc++ >= 20</li></ul></li></ul><p>clice 使用 C++23 作为语言标准,请确保有可用的 clang 20 以及以上的编译器,以及兼容 C++23 的标准库。clice 依赖 lld 作为链接器。请确保你的 clang 工具链可以找到它(通常 clang 发行版会自带 lld,或者你需要单独安装 lld-20 包)。</p><blockquote><p>clice 目前只保证能使用 clang 编译(CI 测试保证)。对于 gcc 和 msvc 的兼容,我们尽力而为,但不会在 CI 中添加对应的测试。如果遇到任何问题,欢迎贡献。</p></blockquote><h2 id="cmake" tabindex="-1">CMake <a class="header-anchor" href="#cmake" aria-label="Permalink to "CMake""></a></h2><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;">cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -B</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_BUILD_TYPE=RelWithDebInfo</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_C_COMPILER=clang</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_CXX_COMPILER=clang++</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cmake</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span></span></code></pre></div><p>可选的构建选项:</p><table tabindex="0"><thead><tr><th>选项</th><th>默认值</th><th>效果</th></tr></thead><tbody><tr><td>LLVM_INSTALL_PATH</td><td>""</td><td>使用自定义路径的 llvm libs 来构建 clice</td></tr><tr><td>CLICE_ENABLE_TEST</td><td>OFF</td><td>是否构建 clice 的单元测试</td></tr><tr><td>CLICE_USE_LIBCXX</td><td>OFF</td><td>是否使用 libc++ 来构建 clice(添加 <code>-std=libc++</code>),如果开启,请确保 llvm libs 也是使用 libc++ 编译的</td></tr><tr><td>CLICE_CI_ENVIRONMENT</td><td>OFF</td><td>是否打开 <code>CLICE_CI_ENVIRONMENT</code> 这个宏,有些测试在 CI 环境才会执行</td></tr></tbody></table><h2 id="xmake" tabindex="-1">XMake <a class="header-anchor" href="#xmake" aria-label="Permalink to "XMake""></a></h2><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;">xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> f</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=releasedbg</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --toolchain=clang</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --all</span></span></code></pre></div><p>可选的构建选项:</p><table tabindex="0"><thead><tr><th>选项</th><th>默认值</th><th>效果</th></tr></thead><tbody><tr><td>--llvm</td><td>""</td><td>使用自定义路径的 llvm libs 来构建 clice</td></tr><tr><td>--enable_test</td><td>false</td><td>是否构建 clice 的单元测试</td></tr><tr><td>--ci</td><td>false</td><td>是否打开 <code>CLICE_CI_ENVIRONMENT</code></td></tr></tbody></table><h2 id="a-note-on-llvm-libs" tabindex="-1">A Note on LLVM Libs <a class="header-anchor" href="#a-note-on-llvm-libs" aria-label="Permalink to "A Note on LLVM Libs""></a></h2><p>由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST,这意味它需要链接 llvm/clang libs。由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。</p><ol><li>我们在 <a href="https://github.com/clice-io/clice-llvm/releases" target="_blank" rel="noreferrer">clice-llvm</a> 上会发布使用的 llvm 版本的预编译二进制,用于 CI 或者 release 构建。在构建时 cmake 和 xmake 默认会从此处下载 llvm libs 然后使用,</li></ol><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>对于 debug 版本的 llvm libs,构建的时候我们开启了 address sanitizer,而 address sanitizer 依赖于 compiler rt,它对编译器版本十分敏感。所以如果使用 debug 版本,请确保你的 clang 的 compiler rt 版本和我们构建的时候<strong>严格一致</strong>。</p><ul><li>Windows 暂时没有 debug 构建的 llvm libs,因为它不支持将 clang 构建为动态库,相关的进展在 <a href="https://github.com/clice-io/clice/issues/42" target="_blank" rel="noreferrer">这里</a> 跟踪</li><li>Linux 使用 clang20</li><li>MacOS 使用 homebrew llvm@20,<strong>不要使用 apple clang</strong></li></ul><p>可以参考 CI 中的 <a href="https://github.com/clice-io/clice/blob/main/.github/workflows/cmake.yml" target="_blank" rel="noreferrer">cmake</a> 和 <a href="https://github.com/clice-io/clice/blob/main/.github/workflows/xmake.yml" target="_blank" rel="noreferrer">xmake</a> 文件作为参考,它们与预编译 llvm libs 的环境保持严格一致。</p></div><ol start="2"><li>自己重新一个与当前环境一致的 llvm/clang。如果默认的预编译二进制文件(方法 1)在你的系统上因 ABI 或库版本(如 glibc)不兼容而运行失败,或者你需要一个自定义的 Debug 版本,那么我们推荐你使用此方法从头编译 llvm libs。我们提供了一个脚本,用于构建 clice 所需要的 llvm libs:<a href="https://github.com/clice-io/clice/blob/main/scripts/build-llvm-libs.py" target="_blank" rel="noreferrer">build-llvm-libs.py</a>。</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:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> llvm-project</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">python3</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">clic</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/scripts/build-llvm-libs.py</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> debug</span></span></code></pre></div><p>也可以参考 llvm 的官方构建教程 <a href="https://llvm.org/docs/CMake.html" target="_blank" rel="noreferrer">Building LLVM with CMake</a>。</p>`,24)]))}const b=i(s,[["render",r]]);export{k as __pageData,b as default};
|
||||
1
assets/zh_dev_build.md.C5-ImQeZ.lean.js
Normal file
1
assets/zh_dev_build.md.C5-ImQeZ.lean.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as i,c as a,o as t,ae as e}from"./chunks/framework.D8webtH5.js";const k=JSON.parse('{"title":"Build from Source","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),s={name:"zh/dev/build.md"};function r(d,l,n,h,c,o){return t(),a("div",null,l[0]||(l[0]=[e("",24)]))}const b=i(s,[["render",r]]);export{k as __pageData,b as default};
|
||||
@@ -1,33 +0,0 @@
|
||||
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 "Build from Source""></a></h1><h2 id="supported-platforms" tabindex="-1">Supported Platforms <a class="header-anchor" href="#supported-platforms" aria-label="Permalink to "Supported Platforms""></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 "Prerequisite""></a></h2><p>本小节介绍编译 clice 的前置依赖。</p><h3 id="toolchain" tabindex="-1">Toolchain <a class="header-anchor" href="#toolchain" aria-label="Permalink to "Toolchain""></a></h3><ul><li>clang >= 19</li><li>c++23 compitable standard library <ul><li>MSVC STL >= 19.44(VS 2022 17.4)</li><li>GCC libstdc++ >= 14</li><li>Clang libc++ >= 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 "LLVM Libs""></a></h3><ul><li>20.1.5 <= llvm libs < 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>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://github.com/clice-io/llvm-binary/releases/download/20.1.5/x86_64-linux-gnu-release.tar.xz"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -xJ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -C</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./.llvm</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># MacOS precompiled binary require macos15+</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>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://github.com/clice-io/llvm-binary/releases/download/20.1.5/arm64-macosx-apple-release.tar.xz"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -xJ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -C</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./.llvm</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Windows precompiled binary only MD runtime support</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -O</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://github.com/clice-io/llvm-binary/releases/download/20.1.5/x64-windows-msvc-release.7z"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 7z</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x64-windows-msvc-release.7z</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "-o.llvm"</span></span></code></pre></div><div class="important custom-block github-alert"><p class="custom-block-title">IMPORTANT</p><p></p><p>对于 debug 版本的 llvm libs,构建的时候我们开启了 address sanitizer,而 address sanitizer 依赖于 compiler rt,它对编译器版本十分敏感。所以如果使用 debug 版本,请确保你的 clang 的 compiler rt 版本和我们构建的时候<strong>严格一致</strong>。</p><ul><li>Windows 暂时无 debug 构建的 llvm libs,因为它不支持将 clang 构建为动态库,相关的进展可以在 <a href="https://discourse.llvm.org/t/llvm-is-buildable-as-a-windows-dll/87748" target="_blank" rel="noreferrer">这里</a> 找到</li><li>Linux 使用 clang20</li><li>MacOS 使用 homebrew llvm@20,一定不要使用 apple clang</li></ul></div><ol start="2"><li>自己从头编译 llvm/clang</li></ol><p>这是最推荐的方式,可以保证环境一致性,避免因为 ABI 不一致而导致的崩溃问题。我们提供了一个脚本,用于构建 clice 所需要的 llvm libs:<a href="https://github.com/clice-io/clice/blob/main/scripts/build-llvm-libs.py" target="_blank" rel="noreferrer">build-llvm-libs.py</a>。</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;"> cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> llvm-project</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> python3</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">clic</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/scripts/build-llvm-libs.py</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> debug</span></span></code></pre></div><p>也可以参考 llvm 的官方构建教程 <a href="https://llvm.org/docs/CMake.html" target="_blank" rel="noreferrer">Building LLVM with CMake</a>。</p><h3 id="gcc-toolchain" tabindex="-1">GCC Toolchain <a class="header-anchor" href="#gcc-toolchain" aria-label="Permalink to "GCC Toolchain""></a></h3><p>clice 要求 GCC libstdc++ >= 14。以下命令使用不同的 GCC 工具链并静态链接其 libstdc++:</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;">cmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ..</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_C_FLAGS=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"--gcc-toolchain=/usr/local/gcc-14.3.0/"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_CXX_FLAGS=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"--gcc-toolchain=/usr/local/gcc-14.3.0/"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -DCMAKE_EXE_LINKER_FLAGS=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"-static-libgcc -static-libstdc++"</span></span></code></pre></div><h2 id="building" tabindex="-1">Building <a class="header-anchor" href="#building" aria-label="Permalink to "Building""></a></h2><p>在处理好前置依赖之后,可以开始构建 clice 了,我们提供 cmake/xmake 两种构建方式。</p><h3 id="cmake" tabindex="-1">CMake <a class="header-anchor" href="#cmake" aria-label="Permalink to "CMake""></a></h3><p>下面是 clice 支持的 cmake 参数</p><ul><li><code>LLVM_INSTALL_PATH</code> 用于指定 llvm libs 的安装路径</li><li><code>CLICE_ENABLE_TEST</code> 是否构建 clice 的单元测试</li></ul><p>例如</p><div class="language-bach vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bach</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>$ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_INSTALL_PATH="./.llvm" -DCLICE_ENABLE_TEST=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</span></span>
|
||||
<span class="line"><span>$ cmake --build build</span></span></code></pre></div><h3 id="xmake" tabindex="-1">Xmake <a class="header-anchor" href="#xmake" aria-label="Permalink to "Xmake""></a></h3><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;"> xmake</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> f</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev=true</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --mode=debug</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --toolchain=clang</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --llvm=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"./.llvm"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --enable_test=true</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;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --all</span></span></code></pre></div><blockquote><p>--llvm 是可选的,如果不指定的话,xmake 会自动下载我们编译好的预编译二进制</p></blockquote><h2 id="dev-container" tabindex="-1">Dev Container <a class="header-anchor" href="#dev-container" aria-label="Permalink to "Dev Container""></a></h2><p>我们提供了 docker 镜像作为预装环境解决方案,可以有效地解决环境配置问题,可通过下列命令使用(不限脚本调用路径,可以直接运行 ./build.sh):</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:#6A737D;--shiki-dark:#6A737D;"># construct container</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker/linux/build.sh</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># run clang container</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker/linux/run.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --compiler</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clang</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># run gcc container</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker/linux/run.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --compiler</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gcc</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># reset container(delete exist container and reset)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker/linux/run.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --reset</span></span></code></pre></div><div class="note custom-block github-alert"><p class="custom-block-title">NOTE</p><p>当前该功能仍处于 Preview 阶段,仅支持 Linux,后续会提供 Windows 平台版本,并可能存在功能改动</p></div><h2 id="building-docker-image" tabindex="-1">Building Docker Image <a class="header-anchor" href="#building-docker-image" aria-label="Permalink to "Building Docker Image""></a></h2><p>使用以下命令构建 docker 镜像:</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;"> build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -t</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span></code></pre></div><p>运行 docker 镜像:</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:#032F62;--shiki-dark:#9ECBFF;"> clice</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --help</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">OVERVIEW:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clice</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> is</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> a</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> new</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> generation</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> of</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> language</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> server</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> for</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> C/C++</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">...</span></span></code></pre></div><p>docker 镜像的目录结构如下:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/opt/clice</span></span>
|
||||
<span class="line"><span>├── bin</span></span>
|
||||
<span class="line"><span>│ ├── clice -> /usr/local/bin/clice</span></span>
|
||||
<span class="line"><span>├── include</span></span>
|
||||
<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>`,50)]))}const F=i(e,[["render",t]]);export{o as __pageData,F as default};
|
||||
@@ -1 +0,0 @@
|
||||
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("",50)]))}const F=i(e,[["render",t]]);export{o as __pageData,F as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -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;"><<</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "Hello world!"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <<</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 <iostream></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 "Cancel Compilation""></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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
@@ -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;"> "a.h"</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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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
@@ -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;"><</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;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>> </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's perspective, completion should also be provided here, since the type of <code>vec2[0]</code> is also <code>vector<T></code>, right? Same as the previous example. But clangd won't provide any completion here. What's the problem? According to the C++ standard, the return type of <code>std::vector<T>::operator[]</code> is <code>std::vector<T>::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's <code>T&</code>. But in libstdc++, its definition is nested in dozens of layers of templates, seemingly for compatibility with old standards? So why can't clangd handle this situation?</p><ol><li>It'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't map it back to the original template parameters</li><li>It doesn'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<std::vector<T>>::reference</code> can be simplified to <code>std::vector<T>&</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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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
@@ -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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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
@@ -1 +1 @@
|
||||
{"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":"BVixu1OK","dev_contribution.md":"BDlGKyx4","dev_test-and-debug.md":"BDhcoSZa","guide_configuration.md":"BX4EXUeC","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":"xrKp7NV4","zh_dev_contribution.md":"DouHFQDZ","zh_dev_test-and-debug.md":"CECWy0Lv","zh_guide_configuration.md":"YRqjuVKw","zh_guide_quick-start.md":"BIzdzWD6","zh_guide_what-is-clice.md":"D_fcfWi8","zh_index.md":"DZmqz5yo"}
|
||||
{"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":"pZgZRssl","dev_contribution.md":"BDlGKyx4","dev_test-and-debug.md":"BDhcoSZa","guide_configuration.md":"BX4EXUeC","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":"C5-ImQeZ","zh_dev_contribution.md":"DouHFQDZ","zh_dev_test-and-debug.md":"CECWy0Lv","zh_guide_configuration.md":"YRqjuVKw","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
@@ -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;"><<</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "Hello world!"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <<</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 <iostream></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 "Cancel Compilation""></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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
@@ -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;"> "a.h"</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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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
@@ -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;"><</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;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>> </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<T></code>吗?和前面一个例子一样。但是 clangd 在这里却不会为你提供任何补全,问题出在哪里?根据 C++ 标准,<code>std::vector<T></code>的<code>operator[]</code>返回的类型是<code>std::vector<T>::reference</code>,这其实是一个 <a href="https://en.cppreference.com/w/cpp/language/dependent_name" target="_blank" rel="noreferrer">dependent name</a>,它的结果似乎相当直接,就是<code>T&</code>。但是 libstdc++ 中它的定义却嵌套了十几层模板,似乎是为了兼容旧标准?那为什么 clangd 不能处理这种情况呢?</p><ol><li>它基于主模板假设,不考虑偏特化可能会使查找无法进行下去</li><li>它只进行名称查找而不进行模板实例化,就算找到了最后的结果,也没法把它和最初的模板参数映射起来</li><li>不考虑默认模板参数,无法处理由默认模板参数导致的依赖名</li></ol><p>尽管我们可以对标准库的类型开洞来提供相关的支持,但是我希望用户的代码能和标准库的代码有相同的地位,那么我们就需要一种通用的算法来处理依赖类型。为了解决这个问题,我编写了一个伪实例化器(pseudo instantiator)。它能在没有具体类型的前提下对依赖类型进行实例化,从而达到化简的目的。比如上面这个例子里面的<code>std::vector<std::vector<T>>::reference</code>就能被化简为<code>std::vector<T>&</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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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
@@ -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\":\"B1nOS2BF\",\"design_compilation.md\":\"CCvAsCts\",\"design_header-context.md\":\"BxMpdImS\",\"design_index.md\":\"iLhzg_qd\",\"design_template-resolver.md\":\"BWRB2TFl\",\"dev_build.md\":\"BVixu1OK\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"xrKp7NV4\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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>
|
||||
<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\":\"pZgZRssl\",\"dev_contribution.md\":\"BDlGKyx4\",\"dev_test-and-debug.md\":\"BDhcoSZa\",\"guide_configuration.md\":\"BX4EXUeC\",\"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\":\"C5-ImQeZ\",\"zh_dev_contribution.md\":\"DouHFQDZ\",\"zh_dev_test-and-debug.md\":\"CECWy0Lv\",\"zh_guide_configuration.md\":\"YRqjuVKw\",\"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
Reference in New Issue
Block a user