diff --git a/404.html b/404.html index 7acecd2c..f4ee5731 100644 --- a/404.html +++ b/404.html @@ -16,7 +16,7 @@
- + \ No newline at end of file diff --git a/assets/build.md.Co74jVci.js b/assets/build.md.Co74jVci.js deleted file mode 100644 index 7d5ed5a5..00000000 --- a/assets/build.md.Co74jVci.js +++ /dev/null @@ -1,19 +0,0 @@ -import{_ as s,c as a,o as e,ae as l}from"./chunks/framework.U1Gow_7P.js";const c=JSON.parse('{"title":"Supported Platforms (CI Tested)","description":"","frontmatter":{},"headers":[],"relativePath":"build.md","filePath":"en/build.md"}'),t={name:"build.md"};function n(h,i,p,k,r,d){return e(),a("div",null,i[0]||(i[0]=[l(`

Supported Platforms (CI Tested)

Dependencies

Building

LLVM

We provide precompiled LLVM binaries for those who don't want to manually build LLVM. If you want to use your own version or debug LLVM, you can continue reading.

clice requires clang's private headers for compilation:

Copy these headers to either:

We provide a script to download these headers to <clice_dir>/include/clang/Sema (require xmake).

bash
xmake l scripts/fetch-clang-headers.lua

CMake

We use CMake find_package in CONFIG mode for dependency resolution.

LLVM precompiled binaries must be installed at -DLLVM_INSTALL_PATH=path/to/llvm.

bash
# .github/workflows/cmake.yml
-
-# Linux precompiled binary require glibc 2.31 (build on ubuntu 20.04)
-$ mkdir -p ./.llvm
-$ curl -L "https://github.com/clice-project/llvm-binary/releases/download/20.0.0/x86_64-linux-gnu-release.tar.xz" | tar -xJ -C ./.llvm
-
-# MacOS precompiled binary require macos15+
-$ mkdir -p ./.llvm
-$ curl -L "https://github.com/clice-project/llvm-binary/releases/download/20.1.5/arm64-macosx-apple-release.tar.xz" | tar -xJ -C ./.llvm
-
-# windows precompiled binary only MD runtime support
-$ curl -O -L "https://github.com/clice-project/llvm-binary/releases/download/20.0.0/x64-windows-msvc-release.7z"
-$ 7z x x64-windows-msvc-release.7z "-o.llvm"
bash
$ cmake -B build -DCLICE_ENABLE_TEST=OFF -DLLVM_INSTALL_PATH=.llvm
-$ cmake --build build

IMPORTANT

The precompiled binary for MacOS is compiled by homebrew llvm@20.

Please use the same toolchain to build clice, DO NOT use Apple Clang.

Xmake

When using Xmake, all dependencies will be automatically handled.

Xmake will find system packages using pkg-config or package managers (e.g., pacman, apt, ...).

If not found, Xmake falls back to downloading dependencies from GitHub, then building and installing them locally.

bash
$ xmake f -c --dev=y --enable_test=n --toolchain=clang
-$ xmake

The dev option will build dependencies using Ninja and set the runtime library to MD (Windows only).

For developer

cmake

Recommended workflow using CMakePresets (require ninja):

bash
$ cmake --preset release
-$ cmake --build --preset release
-$ ./build/bin/unit_tests --test-dir="./tests" --resource-dir="./.llvm/lib/clang/20"

If your system does not have the clang-20 toolchain, please modify cmake/toolchain.cmake to specify the clang version.

xmake

bash
$ xmake f -c --toolchain=clang
-$ xmake build --all
-$ xmake test

If your system does not have the clang-20 toolchain, please pass --toolchain=clang-19 to specify the clang version.

`,34)]))}const F=s(t,[["render",n]]);export{c as __pageData,F as default}; diff --git a/assets/build.md.Co74jVci.lean.js b/assets/build.md.Co74jVci.lean.js deleted file mode 100644 index a0a90468..00000000 --- a/assets/build.md.Co74jVci.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as a,o as e,ae as l}from"./chunks/framework.U1Gow_7P.js";const c=JSON.parse('{"title":"Supported Platforms (CI Tested)","description":"","frontmatter":{},"headers":[],"relativePath":"build.md","filePath":"en/build.md"}'),t={name:"build.md"};function n(h,i,p,k,r,d){return e(),a("div",null,i[0]||(i[0]=[l("",34)]))}const F=s(t,[["render",n]]);export{c as __pageData,F as default}; diff --git a/assets/configuration.md.CpRedDOQ.lean.js b/assets/configuration.md.CpRedDOQ.lean.js deleted file mode 100644 index 239ea677..00000000 --- a/assets/configuration.md.CpRedDOQ.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as a,o as s,ae as i}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"configuration.md","filePath":"en/configuration.md"}'),o={name:"configuration.md"};function n(d,e,l,h,r,c){return s(),a("div",null,e[0]||(e[0]=[i("",60)]))}const u=t(o,[["render",n]]);export{k as __pageData,u as default}; diff --git a/assets/contribution.md.Zb0EHW2I.js b/assets/contribution.md.Zb0EHW2I.js deleted file mode 100644 index 926544bf..00000000 --- a/assets/contribution.md.Zb0EHW2I.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as n,o,j as r}from"./chunks/framework.U1Gow_7P.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"contribution.md","filePath":"en/contribution.md"}'),a={name:"contribution.md"};function i(s,t,c,l,p,d){return o(),n("div",null,t[0]||(t[0]=[r("p",null,"Comment style: lowercase at the beginning.",-1)]))}const _=e(a,[["render",i]]);export{u as __pageData,_ as default}; diff --git a/assets/contribution.md.Zb0EHW2I.lean.js b/assets/contribution.md.Zb0EHW2I.lean.js deleted file mode 100644 index 926544bf..00000000 --- a/assets/contribution.md.Zb0EHW2I.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as n,o,j as r}from"./chunks/framework.U1Gow_7P.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"contribution.md","filePath":"en/contribution.md"}'),a={name:"contribution.md"};function i(s,t,c,l,p,d){return o(),n("div",null,t[0]||(t[0]=[r("p",null,"Comment style: lowercase at the beginning.",-1)]))}const _=e(a,[["render",i]]);export{u as __pageData,_ as default}; diff --git a/assets/feature_document-symbol.md.DsqxMq4k.js b/assets/feature_document-symbol.md.DsqxMq4k.js deleted file mode 100644 index 1f0ab858..00000000 --- a/assets/feature_document-symbol.md.DsqxMq4k.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as t,o,ae as l}from"./chunks/framework.U1Gow_7P.js";const u=JSON.parse('{"title":"Document Symbol","description":"","frontmatter":{},"headers":[],"relativePath":"feature/document-symbol.md","filePath":"en/feature/document-symbol.md"}'),s={name:"feature/document-symbol.md"};function d(r,e,i,c,n,p){return o(),t("div",null,e[0]||(e[0]=[l('

Document Symbol

Supported Case

The full cases mentioned in LSP are listed in.

In clice, the following symbols is included:

  1. Namespace

  2. Free function declaration

  3. Enum, and it's members

  4. Struct, class, add it's fields or methods.
    Abstract class is specified as Interface.

  5. Non-local and non-parameter variables
    They were specified as Constant or Variable based on their declaration.

For all above case, a deprecated tag will be added if the item is marked with [[deprecated]].

',6)]))}const b=a(s,[["render",d]]);export{u as __pageData,b as default}; diff --git a/assets/feature_document-symbol.md.DsqxMq4k.lean.js b/assets/feature_document-symbol.md.DsqxMq4k.lean.js deleted file mode 100644 index 84dbfa11..00000000 --- a/assets/feature_document-symbol.md.DsqxMq4k.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as t,o,ae as l}from"./chunks/framework.U1Gow_7P.js";const u=JSON.parse('{"title":"Document Symbol","description":"","frontmatter":{},"headers":[],"relativePath":"feature/document-symbol.md","filePath":"en/feature/document-symbol.md"}'),s={name:"feature/document-symbol.md"};function d(r,e,i,c,n,p){return o(),t("div",null,e[0]||(e[0]=[l("",6)]))}const b=a(s,[["render",d]]);export{u as __pageData,b as default}; diff --git a/assets/feature_folding-range.md.2DTooAm1.js b/assets/feature_folding-range.md.2DTooAm1.js deleted file mode 100644 index 4f6de1e1..00000000 --- a/assets/feature_folding-range.md.2DTooAm1.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as i,o as n,ae as t}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Folding Range","description":"","frontmatter":{},"headers":[],"relativePath":"feature/folding-range.md","filePath":"en/feature/folding-range.md"}'),l={name:"feature/folding-range.md"};function o(r,e,s,d,c,u){return n(),i("div",null,e[0]||(e[0]=[t('

Folding Range

Supported Cases

',3)]))}const _=a(l,[["render",o]]);export{f as __pageData,_ as default}; diff --git a/assets/feature_folding-range.md.2DTooAm1.lean.js b/assets/feature_folding-range.md.2DTooAm1.lean.js deleted file mode 100644 index 6f6cfdc5..00000000 --- a/assets/feature_folding-range.md.2DTooAm1.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as i,o as n,ae as t}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Folding Range","description":"","frontmatter":{},"headers":[],"relativePath":"feature/folding-range.md","filePath":"en/feature/folding-range.md"}'),l={name:"feature/folding-range.md"};function o(r,e,s,d,c,u){return n(),i("div",null,e[0]||(e[0]=[t("",3)]))}const _=a(l,[["render",o]]);export{f as __pageData,_ as default}; diff --git a/assets/feature_inlay-hint.md.D7ZN-35G.js b/assets/feature_inlay-hint.md.D7ZN-35G.js deleted file mode 100644 index b2693f7d..00000000 --- a/assets/feature_inlay-hint.md.D7ZN-35G.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as i,o as n,ae as t}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Inlay Hint","description":"","frontmatter":{},"headers":[],"relativePath":"feature/inlay-hint.md","filePath":"en/feature/inlay-hint.md"}'),o={name:"feature/inlay-hint.md"};function r(l,e,d,c,s,u){return n(),i("div",null,e[0]||(e[0]=[t('

Inlay Hint

Supported Case

  1. Type hint for variable declared with auto keywords in function/if/for/structure-binding.
  2. Return type hint for function/lambda body.
  3. Parameter name in function call expression.
  4. Block end hint for struct/class/enum declaration and function/lambda body.
  5. Array index for elements in initialize list expression.
  6. Value of sizeof and alignof in struct/class defination.

There is a configurable option, and some examples.

',4)]))}const h=a(o,[["render",r]]);export{p as __pageData,h as default}; diff --git a/assets/feature_inlay-hint.md.D7ZN-35G.lean.js b/assets/feature_inlay-hint.md.D7ZN-35G.lean.js deleted file mode 100644 index e7e1313e..00000000 --- a/assets/feature_inlay-hint.md.D7ZN-35G.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as i,o as n,ae as t}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Inlay Hint","description":"","frontmatter":{},"headers":[],"relativePath":"feature/inlay-hint.md","filePath":"en/feature/inlay-hint.md"}'),o={name:"feature/inlay-hint.md"};function r(l,e,d,c,s,u){return n(),i("div",null,e[0]||(e[0]=[t("",4)]))}const h=a(o,[["render",r]]);export{p as __pageData,h as default}; diff --git a/assets/feature_semantic-tokens.md.B5B0Hwzv.js b/assets/feature_semantic-tokens.md.B5B0Hwzv.js deleted file mode 100644 index 2406116e..00000000 --- a/assets/feature_semantic-tokens.md.B5B0Hwzv.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"feature/semantic-tokens.md","filePath":"en/feature/semantic-tokens.md"}'),n={name:"feature/semantic-tokens.md"};function s(o,r,c,i,m,f){return a(),t("div")}const d=e(n,[["render",s]]);export{_ as __pageData,d as default}; diff --git a/assets/feature_semantic-tokens.md.B5B0Hwzv.lean.js b/assets/feature_semantic-tokens.md.B5B0Hwzv.lean.js deleted file mode 100644 index 2406116e..00000000 --- a/assets/feature_semantic-tokens.md.B5B0Hwzv.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"feature/semantic-tokens.md","filePath":"en/feature/semantic-tokens.md"}'),n={name:"feature/semantic-tokens.md"};function s(o,r,c,i,m,f){return a(),t("div")}const d=e(n,[["render",s]]);export{_ as __pageData,d as default}; diff --git a/assets/guide_quick-start.md.CwDrTxXo.js b/assets/guide_quick-start.md.CwDrTxXo.js deleted file mode 100644 index d2379923..00000000 --- a/assets/guide_quick-start.md.CwDrTxXo.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as r,ae as i}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Qucik started","description":"","frontmatter":{},"headers":[],"relativePath":"guide/quick-start.md","filePath":"en/guide/quick-start.md"}'),o={name:"guide/quick-start.md"};function s(l,a,d,n,h,u){return r(),t("div",null,a[0]||(a[0]=[i('

Qucik started

Installation

Editor plugins

Visual Studio Code

Vim/Neovim

Others

Project setup

CMake

Bazel

Others

',10)]))}const q=e(o,[["render",s]]);export{m as __pageData,q as default}; diff --git a/assets/guide_quick-start.md.CwDrTxXo.lean.js b/assets/guide_quick-start.md.CwDrTxXo.lean.js deleted file mode 100644 index 1c772304..00000000 --- a/assets/guide_quick-start.md.CwDrTxXo.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as r,ae as i}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Qucik started","description":"","frontmatter":{},"headers":[],"relativePath":"guide/quick-start.md","filePath":"en/guide/quick-start.md"}'),o={name:"guide/quick-start.md"};function s(l,a,d,n,h,u){return r(),t("div",null,a[0]||(a[0]=[i("",10)]))}const q=e(o,[["render",s]]);export{m as __pageData,q as default}; diff --git a/assets/zh_design_architecture.md.CWdgG2wH.js b/assets/zh_design_architecture.md.CWdgG2wH.js new file mode 100644 index 00000000..b6147889 --- /dev/null +++ b/assets/zh_design_architecture.md.CWdgG2wH.js @@ -0,0 +1 @@ +import{_ as r,c as a,o as c,j as t,a as i}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/architecture.md","filePath":"zh/design/architecture.md"}'),s={name:"zh/design/architecture.md"};function n(o,e,d,h,u,l){return c(),a("div",null,e[0]||(e[0]=[t("h1",{id:"architecture",tabindex:"-1"},[i("Architecture "),t("a",{class:"header-anchor",href:"#architecture","aria-label":'Permalink to "Architecture"'},"​")],-1)]))}const f=r(s,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/zh_design_architecture.md.CWdgG2wH.lean.js b/assets/zh_design_architecture.md.CWdgG2wH.lean.js new file mode 100644 index 00000000..b6147889 --- /dev/null +++ b/assets/zh_design_architecture.md.CWdgG2wH.lean.js @@ -0,0 +1 @@ +import{_ as r,c as a,o as c,j as t,a as i}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Architecture","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/architecture.md","filePath":"zh/design/architecture.md"}'),s={name:"zh/design/architecture.md"};function n(o,e,d,h,u,l){return c(),a("div",null,e[0]||(e[0]=[t("h1",{id:"architecture",tabindex:"-1"},[i("Architecture "),t("a",{class:"header-anchor",href:"#architecture","aria-label":'Permalink to "Architecture"'},"​")],-1)]))}const f=r(s,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/zh_design_compilation-task.md.CRasWF8z.js b/assets/zh_design_compilation-task.md.CRasWF8z.js deleted file mode 100644 index 40e1752b..00000000 --- a/assets/zh_design_compilation-task.md.CRasWF8z.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as e,o as a}from"./chunks/framework.U1Gow_7P.js";const l=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation-task.md","filePath":"zh/design/compilation-task.md"}'),o={name:"zh/design/compilation-task.md"};function s(n,i,c,r,p,d){return a(),e("div")}const _=t(o,[["render",s]]);export{l as __pageData,_ as default}; diff --git a/assets/zh_design_compilation-task.md.CRasWF8z.lean.js b/assets/zh_design_compilation-task.md.CRasWF8z.lean.js deleted file mode 100644 index 40e1752b..00000000 --- a/assets/zh_design_compilation-task.md.CRasWF8z.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as e,o as a}from"./chunks/framework.U1Gow_7P.js";const l=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation-task.md","filePath":"zh/design/compilation-task.md"}'),o={name:"zh/design/compilation-task.md"};function s(n,i,c,r,p,d){return a(),e("div")}const _=t(o,[["render",s]]);export{l as __pageData,_ as default}; diff --git a/assets/zh_design_compilation.md.DfE77o6C.js b/assets/zh_design_compilation.md.DfE77o6C.js new file mode 100644 index 00000000..eac19d9e --- /dev/null +++ b/assets/zh_design_compilation.md.DfE77o6C.js @@ -0,0 +1,5 @@ +import{_ as i,c as s,o as e,ae as n}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation.md","filePath":"zh/design/compilation.md"}'),t={name:"zh/design/compilation.md"};function l(p,a,o,r,h,c){return e(),s("div",null,a[0]||(a[0]=[n(`

Compilation

Incremental Parsing

每当你修改代码时,clice 都必须重新解析文件。clice 使用一种叫做 preamble 的机制实现增量编译以加快重新解析速度。preamble 可被视为 Precompiled Header 的一种特殊情况(内嵌在源文件中)。在打开文件的时候,它会将文件开头的几个预处理指令(被叫做 preamble)构建成 PCH 缓存在磁盘上,后续在解析的时候则可以直接加载 PCH 文件,从而跳过前面几个预处理指令,这样可以大大减少要重新解析的代码量。

例如,对于如下的代码

cpp
#include <iostream>
+
+int main () {
+    std::cout << "Hello world!" << std::endl;
+}

iostream 这个头文件大概有 2w 行代码,clice 会先把 #include <iostream> 这一行代码构建成 PCH 文件,在完成之后在使用这个 PCH 文件来解析后面的代码。这样的话后续重新解析的代码量就只剩 5 行了,而不是原本的 2w 行,速度会变得非常快。除非你修改了 preamble 部分的代码,导致需要构建新的 preamble。

Cancel Compilation

`,7)]))}const m=i(t,[["render",l]]);export{k as __pageData,m as default}; diff --git a/assets/zh_design_compilation.md.DfE77o6C.lean.js b/assets/zh_design_compilation.md.DfE77o6C.lean.js new file mode 100644 index 00000000..769c2de0 --- /dev/null +++ b/assets/zh_design_compilation.md.DfE77o6C.lean.js @@ -0,0 +1 @@ +import{_ as i,c as s,o as e,ae as n}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Compilation","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/compilation.md","filePath":"zh/design/compilation.md"}'),t={name:"zh/design/compilation.md"};function l(p,a,o,r,h,c){return e(),s("div",null,a[0]||(a[0]=[n("",7)]))}const m=i(t,[["render",l]]);export{k as __pageData,m as default}; diff --git a/assets/zh_design_header-context.md.BEaf4C-z.js b/assets/zh_design_header-context.md.BEaf4C-z.js new file mode 100644 index 00000000..9e485dbe --- /dev/null +++ b/assets/zh_design_header-context.md.BEaf4C-z.js @@ -0,0 +1 @@ +import{_ as a,c as r,o as n,j as t,a as o}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),d={name:"zh/design/header-context.md"};function s(c,e,i,h,x,l){return n(),r("div",null,e[0]||(e[0]=[t("h1",{id:"header-context",tabindex:"-1"},[o("Header Context "),t("a",{class:"header-anchor",href:"#header-context","aria-label":'Permalink to "Header Context"'},"​")],-1)]))}const f=a(d,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/zh_design_header-context.md.BEaf4C-z.lean.js b/assets/zh_design_header-context.md.BEaf4C-z.lean.js new file mode 100644 index 00000000..9e485dbe --- /dev/null +++ b/assets/zh_design_header-context.md.BEaf4C-z.lean.js @@ -0,0 +1 @@ +import{_ as a,c as r,o as n,j as t,a as o}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Header Context","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),d={name:"zh/design/header-context.md"};function s(c,e,i,h,x,l){return n(),r("div",null,e[0]||(e[0]=[t("h1",{id:"header-context",tabindex:"-1"},[o("Header Context "),t("a",{class:"header-anchor",href:"#header-context","aria-label":'Permalink to "Header Context"'},"​")],-1)]))}const f=a(d,[["render",s]]);export{m as __pageData,f as default}; diff --git a/assets/zh_design_header-context.md.JzQT9F1p.js b/assets/zh_design_header-context.md.JzQT9F1p.js deleted file mode 100644 index d87a004e..00000000 --- a/assets/zh_design_header-context.md.JzQT9F1p.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),n={name:"zh/design/header-context.md"};function r(o,s,c,d,i,h){return a(),t("div")}const m=e(n,[["render",r]]);export{_ as __pageData,m as default}; diff --git a/assets/zh_design_header-context.md.JzQT9F1p.lean.js b/assets/zh_design_header-context.md.JzQT9F1p.lean.js deleted file mode 100644 index d87a004e..00000000 --- a/assets/zh_design_header-context.md.JzQT9F1p.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/header-context.md","filePath":"zh/design/header-context.md"}'),n={name:"zh/design/header-context.md"};function r(o,s,c,d,i,h){return a(),t("div")}const m=e(n,[["render",r]]);export{_ as __pageData,m as default}; diff --git a/assets/zh_design_index.md.DHNbht8F.js b/assets/zh_design_index.md.DHNbht8F.js new file mode 100644 index 00000000..7ce7f2d4 --- /dev/null +++ b/assets/zh_design_index.md.DHNbht8F.js @@ -0,0 +1 @@ +import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/index.md","filePath":"zh/design/index.md"}'),s={name:"zh/design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"​")],-1)]))}const h=n(s,[["render",i]]);export{f as __pageData,h as default}; diff --git a/assets/zh_design_index.md.DHNbht8F.lean.js b/assets/zh_design_index.md.DHNbht8F.lean.js new file mode 100644 index 00000000..7ce7f2d4 --- /dev/null +++ b/assets/zh_design_index.md.DHNbht8F.lean.js @@ -0,0 +1 @@ +import{_ as n,c as t,o as d,j as a,a as r}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Index","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/index.md","filePath":"zh/design/index.md"}'),s={name:"zh/design/index.md"};function i(o,e,c,x,l,p){return d(),t("div",null,e[0]||(e[0]=[a("h1",{id:"index",tabindex:"-1"},[r("Index "),a("a",{class:"header-anchor",href:"#index","aria-label":'Permalink to "Index"'},"​")],-1)]))}const h=n(s,[["render",i]]);export{f as __pageData,h as default}; diff --git a/assets/zh_design_template-resolver.md.DNGBj6oC.js b/assets/zh_design_template-resolver.md.DNGBj6oC.js new file mode 100644 index 00000000..d99a690c --- /dev/null +++ b/assets/zh_design_template-resolver.md.DNGBj6oC.js @@ -0,0 +1 @@ +import{_ as a,c as r,o as s,j as t,a as l}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),o={name:"zh/design/template-resolver.md"};function n(p,e,m,d,i,c){return s(),r("div",null,e[0]||(e[0]=[t("h1",{id:"template-resolver",tabindex:"-1"},[l("Template Resolver "),t("a",{class:"header-anchor",href:"#template-resolver","aria-label":'Permalink to "Template Resolver"'},"​")],-1)]))}const h=a(o,[["render",n]]);export{f as __pageData,h as default}; diff --git a/assets/zh_design_template-resolver.md.DNGBj6oC.lean.js b/assets/zh_design_template-resolver.md.DNGBj6oC.lean.js new file mode 100644 index 00000000..d99a690c --- /dev/null +++ b/assets/zh_design_template-resolver.md.DNGBj6oC.lean.js @@ -0,0 +1 @@ +import{_ as a,c as r,o as s,j as t,a as l}from"./chunks/framework.U1Gow_7P.js";const f=JSON.parse('{"title":"Template Resolver","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),o={name:"zh/design/template-resolver.md"};function n(p,e,m,d,i,c){return s(),r("div",null,e[0]||(e[0]=[t("h1",{id:"template-resolver",tabindex:"-1"},[l("Template Resolver "),t("a",{class:"header-anchor",href:"#template-resolver","aria-label":'Permalink to "Template Resolver"'},"​")],-1)]))}const h=a(o,[["render",n]]);export{f as __pageData,h as default}; diff --git a/assets/zh_design_template-resolver.md.fGt2KNxS.js b/assets/zh_design_template-resolver.md.fGt2KNxS.js deleted file mode 100644 index ea0649e2..00000000 --- a/assets/zh_design_template-resolver.md.fGt2KNxS.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as r}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),a={name:"zh/design/template-resolver.md"};function s(o,n,c,l,p,d){return r(),t("div")}const _=e(a,[["render",s]]);export{m as __pageData,_ as default}; diff --git a/assets/zh_design_template-resolver.md.fGt2KNxS.lean.js b/assets/zh_design_template-resolver.md.fGt2KNxS.lean.js deleted file mode 100644 index ea0649e2..00000000 --- a/assets/zh_design_template-resolver.md.fGt2KNxS.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as r}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/design/template-resolver.md","filePath":"zh/design/template-resolver.md"}'),a={name:"zh/design/template-resolver.md"};function s(o,n,c,l,p,d){return r(),t("div")}const _=e(a,[["render",s]]);export{m as __pageData,_ as default}; diff --git a/assets/zh_development_build.md.DQ0u_rdw.js b/assets/zh_dev_build.md.D0ygseBD.js similarity index 81% rename from assets/zh_development_build.md.DQ0u_rdw.js rename to assets/zh_dev_build.md.D0ygseBD.js index 4c0e2a65..3c230d96 100644 --- a/assets/zh_development_build.md.DQ0u_rdw.js +++ b/assets/zh_dev_build.md.D0ygseBD.js @@ -1,4 +1,4 @@ -import{_ as i,c as a,o as l,ae as e}from"./chunks/framework.U1Gow_7P.js";const o=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/development/build.md","filePath":"zh/development/build.md"}'),t={name:"zh/development/build.md"};function n(h,s,p,k,r,d){return l(),a("div",null,s[0]||(s[0]=[e(`

Supported Platforms (CI Tested)

Prerequisite

本小节介绍编译 clice 的前置依赖。

Toolchain

clice 使用 C++23 作为语言标准 ,请确保有可用的 clang 19 以及以上的编译器,以及兼容 C++23 的标准库。

clice 暂时只能使用 clang 编译,在未来我们会改进这一点,使其能使用 gcc 和 msvc 编译。

LLVM Libs

由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST,这意味它需要链接 llvm/clang libs。另外由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。

如果你能找到系统的 llvm package 对应的 llvm commit,将该 commit 下的如下三个文件

拷贝到 LLVM_INSTALL_PATH/include/clang/Sema/ 中即可。

除了这种方法以外,还有两种办法获取 clice 所需的 llvm libs:

  1. 使用我们提供的预编译版本
bash
# .github/workflows/cmake.yml
+import{_ as i,c as a,o as l,ae as e}from"./chunks/framework.U1Gow_7P.js";const o=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),t={name:"zh/dev/build.md"};function n(h,s,p,k,r,d){return l(),a("div",null,s[0]||(s[0]=[e(`

Supported Platforms (CI Tested)

  • Windows
  • Linux
  • MacOS

Prerequisite

本小节介绍编译 clice 的前置依赖。

Toolchain

  • clang >= 19
  • c++23 compitable standard library
    • MSVC STL >= 19.44(VS 2022 17.4)
    • GCC libstdc++ >= 14
    • Clang libc++ >= 20

clice 使用 C++23 作为语言标准 ,请确保有可用的 clang 19 以及以上的编译器,以及兼容 C++23 的标准库。

clice 暂时只能使用 clang 编译,在未来我们会改进这一点,使其能使用 gcc 和 msvc 编译。

LLVM Libs

  • 20.1.5 <= llvm libs < 21

由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST,这意味它需要链接 llvm/clang libs。另外由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。

如果你能找到系统的 llvm package 对应的 llvm commit,将该 commit 下的如下三个文件

  • clang/lib/Sema/CoroutineStmtBuilder.h
  • clang/lib/Sema/TypeLocBuilder.h
  • clang/lib/Sema/TreeTransform.h

拷贝到 LLVM_INSTALL_PATH/include/clang/Sema/ 中即可。

除了这种方法以外,还有两种办法获取 clice 所需的 llvm libs:

  1. 使用我们提供的预编译版本
bash
# .github/workflows/cmake.yml
 
 # Linux precompiled binary require glibc 2.35 (build on ubuntu 22.04)
 $ mkdir -p ./.llvm
diff --git a/assets/zh_dev_build.md.D0ygseBD.lean.js b/assets/zh_dev_build.md.D0ygseBD.lean.js
new file mode 100644
index 00000000..252bb90d
--- /dev/null
+++ b/assets/zh_dev_build.md.D0ygseBD.lean.js
@@ -0,0 +1 @@
+import{_ as i,c as a,o as l,ae as e}from"./chunks/framework.U1Gow_7P.js";const o=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/build.md","filePath":"zh/dev/build.md"}'),t={name:"zh/dev/build.md"};function n(h,s,p,k,r,d){return l(),a("div",null,s[0]||(s[0]=[e("",42)]))}const F=i(t,[["render",n]]);export{o as __pageData,F as default};
diff --git a/assets/zh_dev_contribution.md.CtDPz8pA.js b/assets/zh_dev_contribution.md.CtDPz8pA.js
new file mode 100644
index 00000000..77fda1a9
--- /dev/null
+++ b/assets/zh_dev_contribution.md.CtDPz8pA.js
@@ -0,0 +1 @@
+import{_ as o,c as n,o as r,j as t,a}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/contribution.md","filePath":"zh/dev/contribution.md"}'),i={name:"zh/dev/contribution.md"};function c(s,e,d,l,u,p){return r(),n("div",null,e[0]||(e[0]=[t("h1",{id:"contribution",tabindex:"-1"},[a("Contribution "),t("a",{class:"header-anchor",href:"#contribution","aria-label":'Permalink to "Contribution"'},"​")],-1),t("p",null,"我们欢迎任何贡献!",-1)]))}const f=o(i,[["render",c]]);export{m as __pageData,f as default};
diff --git a/assets/zh_dev_contribution.md.CtDPz8pA.lean.js b/assets/zh_dev_contribution.md.CtDPz8pA.lean.js
new file mode 100644
index 00000000..77fda1a9
--- /dev/null
+++ b/assets/zh_dev_contribution.md.CtDPz8pA.lean.js
@@ -0,0 +1 @@
+import{_ as o,c as n,o as r,j as t,a}from"./chunks/framework.U1Gow_7P.js";const m=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/dev/contribution.md","filePath":"zh/dev/contribution.md"}'),i={name:"zh/dev/contribution.md"};function c(s,e,d,l,u,p){return r(),n("div",null,e[0]||(e[0]=[t("h1",{id:"contribution",tabindex:"-1"},[a("Contribution "),t("a",{class:"header-anchor",href:"#contribution","aria-label":'Permalink to "Contribution"'},"​")],-1),t("p",null,"我们欢迎任何贡献!",-1)]))}const f=o(i,[["render",c]]);export{m as __pageData,f as default};
diff --git a/assets/zh_development_build.md.DQ0u_rdw.lean.js b/assets/zh_development_build.md.DQ0u_rdw.lean.js
deleted file mode 100644
index 4e5928bb..00000000
--- a/assets/zh_development_build.md.DQ0u_rdw.lean.js
+++ /dev/null
@@ -1 +0,0 @@
-import{_ as i,c as a,o as l,ae as e}from"./chunks/framework.U1Gow_7P.js";const o=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"zh/development/build.md","filePath":"zh/development/build.md"}'),t={name:"zh/development/build.md"};function n(h,s,p,k,r,d){return l(),a("div",null,s[0]||(s[0]=[e("",42)]))}const F=i(t,[["render",n]]);export{o as __pageData,F as default};
diff --git a/assets/zh_development_contribution.md.VhnPZehF.js b/assets/zh_development_contribution.md.VhnPZehF.js
deleted file mode 100644
index 694664de..00000000
--- a/assets/zh_development_contribution.md.VhnPZehF.js
+++ /dev/null
@@ -1 +0,0 @@
-import{_ as a,c as e,o,ae as n}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/development/contribution.md","filePath":"zh/development/contribution.md"}'),r={name:"zh/development/contribution.md"};function i(l,t,c,d,h,s){return o(),e("div",null,t[0]||(t[0]=[n('

Contribution

',4)]))}const b=a(r,[["render",i]]);export{_ as __pageData,b as default}; diff --git a/assets/zh_development_contribution.md.VhnPZehF.lean.js b/assets/zh_development_contribution.md.VhnPZehF.lean.js deleted file mode 100644 index 448a864b..00000000 --- a/assets/zh_development_contribution.md.VhnPZehF.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,c as e,o,ae as n}from"./chunks/framework.U1Gow_7P.js";const _=JSON.parse('{"title":"Contribution","description":"","frontmatter":{},"headers":[],"relativePath":"zh/development/contribution.md","filePath":"zh/development/contribution.md"}'),r={name:"zh/development/contribution.md"};function i(l,t,c,d,h,s){return o(),e("div",null,t[0]||(t[0]=[n("",4)]))}const b=a(r,[["render",i]]);export{_ as __pageData,b as default}; diff --git a/assets/configuration.md.CpRedDOQ.js b/assets/zh_guide_configuration.md.C92jpGuF.js similarity index 91% rename from assets/configuration.md.CpRedDOQ.js rename to assets/zh_guide_configuration.md.C92jpGuF.js index 45eae10e..d74b05cb 100644 --- a/assets/configuration.md.CpRedDOQ.js +++ b/assets/zh_guide_configuration.md.C92jpGuF.js @@ -1,4 +1,4 @@ -import{_ as t,c as a,o as s,ae as i}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"configuration.md","filePath":"en/configuration.md"}'),o={name:"configuration.md"};function n(d,e,l,h,r,c){return s(),a("div",null,e[0]||(e[0]=[i(`

Configuration

This is the document of

Server

NameTypeDefault
server.moduleSupportbooleanfalse

Whether to enable module support.

NameTypeDefault
server.overSearchbooleantrue
  • false: Limits the symbol search scope to files connected through the include graph, which is efficient but does not handle symbols defined independently in other files.

For example:

cpp
/// a.h
+import{_ as t,c as a,o as s,ae as i}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/configuration.md","filePath":"zh/guide/configuration.md"}'),o={name:"zh/guide/configuration.md"};function n(d,e,l,h,r,c){return s(),a("div",null,e[0]||(e[0]=[i(`

Configuration

This is the document of

Server

NameTypeDefault
server.moduleSupportbooleanfalse

Whether to enable module support.

NameTypeDefault
server.overSearchbooleantrue
  • false: Limits the symbol search scope to files connected through the include graph, which is efficient but does not handle symbols defined independently in other files.

For example:

cpp
/// a.h
 struct Foo {};
 
 /// b.cpp
diff --git a/assets/zh_guide_configuration.md.C92jpGuF.lean.js b/assets/zh_guide_configuration.md.C92jpGuF.lean.js
new file mode 100644
index 00000000..c708a4ce
--- /dev/null
+++ b/assets/zh_guide_configuration.md.C92jpGuF.lean.js
@@ -0,0 +1 @@
+import{_ as t,c as a,o as s,ae as i}from"./chunks/framework.U1Gow_7P.js";const k=JSON.parse('{"title":"Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/configuration.md","filePath":"zh/guide/configuration.md"}'),o={name:"zh/guide/configuration.md"};function n(d,e,l,h,r,c){return s(),a("div",null,e[0]||(e[0]=[i("",60)]))}const u=t(o,[["render",n]]);export{k as __pageData,u as default};
diff --git a/assets/zh_guide_quick-start.md.CcQPc5x5.js b/assets/zh_guide_quick-start.md.CcQPc5x5.js
new file mode 100644
index 00000000..26886921
--- /dev/null
+++ b/assets/zh_guide_quick-start.md.CcQPc5x5.js
@@ -0,0 +1 @@
+import{_ as e,c as t,o as i,ae as o}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/quick-start.md","filePath":"zh/guide/quick-start.md"}'),r={name:"zh/guide/quick-start.md"};function l(c,a,s,d,n,h){return i(),t("div",null,a[0]||(a[0]=[o('

Quick Start

Editor Plugins

clice 实现了 Language Server Protocol,任何支持该协议的编辑器原则上均可以与 clice 一起使用,提供像 code completion, diagnostics, go-to-definition, 等等。

但是除了标准协议之外,clice 还支持一些协议扩展,为了更好的处理这些协议扩展以及更好的与编辑器集成。使用特定编辑器中的 clice 插件往往是更好的选择,它们大多数都是开箱即用的,并且支持 clice 的协议扩展。

Visual Studio Code

Vim/Neovim

Others

其它的编辑器还没有可用的 clice 插件(欢迎贡献!),为了在它们中使用 clice,请自行安装 clice 并参考特定编辑器的文档关于如何使用一个语言服务器。

Installation

如果你的编辑器插件负责了 clice 的下载,可以跳过这一步。

Download Prebuilt Binary

通过 Release 界面下载 clice 二进制版本。

Build from Source

自己从源码编译 clice,具体的步骤参考 build

Project Setup

为了让 clice 能正确理解你的代码(例如找到头文件的位置),需要为 clice 提供一份 compile_commands.json 文件,也就说所谓的 编译数据库。编译数据库中提供了每个源文件的编译选项。

CMake

对于使用 cmake 的构建系统来说,在构建的时候添加 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 选项即可,例如

cmake
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

这会在 build 目录下生成一份 compile_commands.json 文件。

WARNING

注意:只有当 cmake 的生成器选择为 makefile 和 ninja 的时候,这个选项才有作用。对于其它生成器会忽略这个选项,也就是说无法生成编译数据库。

Bazel

TODO:

Visual Studio

TODO:

Makefile

TODO:

Xmake

Others

对于任意其它的构建系统,可以尝试使用 bear 或者 scan-build 来拦截编译命令并获取到编译数据库(不保证成功)。我们计划在未来编写一个新的工具,通过假编译器的方式来实现编译命令的捕获。

',30)]))}const m=e(r,[["render",l]]);export{p as __pageData,m as default}; diff --git a/assets/zh_guide_quick-start.md.DMOksTiB.lean.js b/assets/zh_guide_quick-start.md.CcQPc5x5.lean.js similarity index 84% rename from assets/zh_guide_quick-start.md.DMOksTiB.lean.js rename to assets/zh_guide_quick-start.md.CcQPc5x5.lean.js index 90c66204..c8c1394b 100644 --- a/assets/zh_guide_quick-start.md.DMOksTiB.lean.js +++ b/assets/zh_guide_quick-start.md.CcQPc5x5.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as i,ae as o}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/quick-start.md","filePath":"zh/guide/quick-start.md"}'),r={name:"zh/guide/quick-start.md"};function l(c,a,s,n,d,h){return i(),t("div",null,a[0]||(a[0]=[o("",30)]))}const m=e(r,[["render",l]]);export{p as __pageData,m as default}; +import{_ as e,c as t,o as i,ae as o}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/quick-start.md","filePath":"zh/guide/quick-start.md"}'),r={name:"zh/guide/quick-start.md"};function l(c,a,s,d,n,h){return i(),t("div",null,a[0]||(a[0]=[o("",30)]))}const m=e(r,[["render",l]]);export{p as __pageData,m as default}; diff --git a/assets/zh_guide_quick-start.md.DMOksTiB.js b/assets/zh_guide_quick-start.md.DMOksTiB.js deleted file mode 100644 index e2137d1c..00000000 --- a/assets/zh_guide_quick-start.md.DMOksTiB.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o as i,ae as o}from"./chunks/framework.U1Gow_7P.js";const p=JSON.parse('{"title":"Quick Start","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/quick-start.md","filePath":"zh/guide/quick-start.md"}'),r={name:"zh/guide/quick-start.md"};function l(c,a,s,n,d,h){return i(),t("div",null,a[0]||(a[0]=[o('

Quick Start

Editor Plugins

clice 实现了 Language Server Protocol,任何支持该协议的编辑器原则上均可以与 clice 一起使用,提供像 code completion, diagnostics, go-to-definition, 等等。

但是除了标准协议之外,clice 还支持一些协议扩展,为了更好的处理这些协议扩展以及更好的与编辑器集成。使用特定编辑器中的 clice 插件往往是更好的选择,它们大多数都是开箱即用的,并且支持 clice 的协议扩展。

Visual Studio Code

Vim/Neovim

Others

其它的编辑器还没有可用的 clice 插件(欢迎贡献!),为了在它们中使用 clice,请自行安装 clice 并参考特定编辑器的文档关于如何使用一个语言服务器。

Installation

如果你的编辑器插件负责了 clice 的下载,可以跳过这一步。

Download Prebuilt Binary

通过 Release 界面下载 clice 二进制版本。

Build from Source

自己从源码编译 clice,具体的步骤参考 build

Project Setup

为了让 clice 能正确理解你的代码(例如找到头文件的位置),需要为 clice 提供一份 compile_commands.json 文件,也就说所谓的 编译数据库。编译数据库中提供了每个源文件的编译选项。

CMake

对于使用 cmake 的构建系统来说,在构建的时候添加 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 选项即可,例如

cmake
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

这会在 build 目录下生成一份 compile_commands.json 文件。

WARNING

注意:只有当 cmake 的生成器选择为 makefile 和 ninja 的时候,这个选项才有作用。对于其它生成器会忽略这个选项,也就是说无法生成编译数据库。

Bazel

TODO:

Visual Studio

TODO:

Makefile

TODO:

Xmake

Others

对于任意其它的构建系统,可以尝试使用 bear 或者 scan-build 来拦截编译命令并获取到编译数据库(不保证成功)。我们计划在未来编写一个新的工具,通过假编译器的方式来实现编译命令的捕获。

',30)]))}const m=e(r,[["render",l]]);export{p as __pageData,m as default}; diff --git a/build.html b/build.html deleted file mode 100644 index 4686840f..00000000 --- a/build.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Supported Platforms (CI Tested) | clice - - - - - - - - - - - - - - -
Skip to content

Supported Platforms (CI Tested)

  • Windows
  • Linux
  • MacOS

Dependencies

Building

LLVM

We provide precompiled LLVM binaries for those who don't want to manually build LLVM. If you want to use your own version or debug LLVM, you can continue reading.

clice requires clang's private headers for compilation:

  • clang/lib/Sema/CoroutineStmtBuilder.h
  • clang/lib/Sema/TypeLocBuilder.h
  • clang/lib/Sema/TreeTransform.h

Copy these headers to either:

  • <clice_dir>/include/clang/Sema
  • <LLVM_INSTALL_PATH>/include/clang/Sema

We provide a script to download these headers to <clice_dir>/include/clang/Sema (require xmake).

bash
xmake l scripts/fetch-clang-headers.lua

CMake

We use CMake find_package in CONFIG mode for dependency resolution.

LLVM precompiled binaries must be installed at -DLLVM_INSTALL_PATH=path/to/llvm.

bash
# .github/workflows/cmake.yml
-
-# Linux precompiled binary require glibc 2.31 (build on ubuntu 20.04)
-$ mkdir -p ./.llvm
-$ curl -L "https://github.com/clice-project/llvm-binary/releases/download/20.0.0/x86_64-linux-gnu-release.tar.xz" | tar -xJ -C ./.llvm
-
-# MacOS precompiled binary require macos15+
-$ mkdir -p ./.llvm
-$ curl -L "https://github.com/clice-project/llvm-binary/releases/download/20.1.5/arm64-macosx-apple-release.tar.xz" | tar -xJ -C ./.llvm
-
-# windows precompiled binary only MD runtime support
-$ curl -O -L "https://github.com/clice-project/llvm-binary/releases/download/20.0.0/x64-windows-msvc-release.7z"
-$ 7z x x64-windows-msvc-release.7z "-o.llvm"
bash
$ cmake -B build -DCLICE_ENABLE_TEST=OFF -DLLVM_INSTALL_PATH=.llvm
-$ cmake --build build

IMPORTANT

The precompiled binary for MacOS is compiled by homebrew llvm@20.

Please use the same toolchain to build clice, DO NOT use Apple Clang.

Xmake

When using Xmake, all dependencies will be automatically handled.

Xmake will find system packages using pkg-config or package managers (e.g., pacman, apt, ...).

If not found, Xmake falls back to downloading dependencies from GitHub, then building and installing them locally.

bash
$ xmake f -c --dev=y --enable_test=n --toolchain=clang
-$ xmake

The dev option will build dependencies using Ninja and set the runtime library to MD (Windows only).

For developer

cmake

Recommended workflow using CMakePresets (require ninja):

bash
$ cmake --preset release
-$ cmake --build --preset release
-$ ./build/bin/unit_tests --test-dir="./tests" --resource-dir="./.llvm/lib/clang/20"

If your system does not have the clang-20 toolchain, please modify cmake/toolchain.cmake to specify the clang version.

xmake

bash
$ xmake f -c --toolchain=clang
-$ xmake build --all
-$ xmake test

If your system does not have the clang-20 toolchain, please pass --toolchain=clang-19 to specify the clang version.

- - - - \ No newline at end of file diff --git a/contribution.html b/contribution.html deleted file mode 100644 index a6d36a95..00000000 --- a/contribution.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - clice - - - - - - - - - - - - - - -
Skip to content

Comment style: lowercase at the beginning.

- - - - \ No newline at end of file diff --git a/design/architecture.html b/design/architecture.html index 7eaa8e64..3a428029 100644 --- a/design/architecture.html +++ b/design/architecture.html @@ -19,7 +19,7 @@
Skip to content

Design of clice

Server

clice is a language server, which is also a kind of server. It uses libuv as the event library and follows the common event-driven model. The main thread handles requests and distributes tasks, while the thread pool executes the actual tasks. Related code is located in the Server directory. It generally is responsible for the following tasks:

  • communicate with the client
  • initialize the server
  • distrubute tasks to the thread pool
  • manage all opened files

Protocol

describe the LSP specification with C++ struct definition.

AST

The main focus is to encapsulate some compiler interfaces of Clang.

  • build preamble
  • build AST
  • capture macros
  • capture diagnostics
  • resolve template
  • implement SelectionTree

TODO: add more details

Index

mainly about how to build index and how to use it.

TODO: add more details

Feature

specific LSP feature implementations.

Support

some useful utilities.

- + \ No newline at end of file diff --git a/design/clangd.html b/design/clangd.html index 75b414fa..971f5947 100644 --- a/design/clangd.html +++ b/design/clangd.html @@ -19,7 +19,7 @@
Skip to content

Completion

Hint

Semantic Highlight

Action

- + \ No newline at end of file diff --git a/design/dependent-name.html b/design/dependent-name.html index 033c4be2..167a7dc8 100644 --- a/design/dependent-name.html +++ b/design/dependent-name.html @@ -48,7 +48,7 @@ std::vector<std::vector<T>> vec2; vec2[0].^ }

According to the C++ standard, the type of vec2[0] is std::vector<std::vector<T>>::reference. Oh, damn, still a dependent name.

Heuristic

- + \ No newline at end of file diff --git a/design/design.html b/design/design.html index caff91e0..77ab94c4 100644 --- a/design/design.html +++ b/design/design.html @@ -19,7 +19,7 @@
Skip to content

"architectural issue" here actually means the issue which can be solved but need to make a lot of modification to clangd. Currently, such big modification can be hard to push because of lack resource in clangd as mentioned here. I am a university student, also a c++ enthusiast and a vscode user. So I have a lot of time that I can dedicate to things I am interested in.. At first, I just want to wonder whether I can make some efforts to clangd. But gradually, I found it could be better to rewrite a new LSP. After evaluating the project scale, I think it's possible to complete for just one person (about 4w~ lines and ccls is also written by one person). Then I start to dive into clangd source code and learn the clang base. So far, I have known how to build preamble, how to build AST, how to traverse AST and so on. All of them are done with clang's C++ API. Next step is putting them together into final program. However, before the actual implementation, I need to plan out its structure.

At first, how to manage message? LSP is also a type of server, and the common event-driven model is sufficient. I plan to use libuv as the event library, with the main thread handling requests and distributing tasks, while the thread pool executes the actual tasks. This is slightly different from clangd's current model; clangd doesn't use a thread pool, but rather creates a new thread for each file and uses semaphore to limit the number of active threads.

Then we need to handle TU. I decided to use a different policy with clangd, which is not to build the preamble for the file until the first edit, and headers will reuse the AST in the source file by default, also until first edit. In this way, we can reduce a lot of memory usage, speed up the loading (building preamble always needs more time compared to normal AST building) and support non self contained header. This can be very useful, people actually only need to modify a few files in big projects like LLVM. And today I found Sam also reported this issue. Another important problem is how to interact with C++20 modules, I am still exploring this.

Next is about indexing, current indexer in clangd seems to be efficient enough, so I think I would reuse it and make only some small modifications to record more information. Also, I am wondering whether we can modify the absolute path to relative path in the index, so issue like support offline background index preparation。It shouldn't be hard to implement.

Following is discussion on some specific LSP features:

Semantic Highlight

There are several issues around it.

Mainly about wrong or not enough information in the semantic highlight. I would like to support detail information for each token, then we can solve all of them.

Hint

Most of these problems are about hint. Providing options to allow users to configure them will be fine.

Action

Providing more actions will be helpful.

Code Completion

These issues around code completion could be hardest to resolve. We need to modify the Parser and SemaComplete in clang to support them. Some are about templates, improving HeuristicResolver will resolve them.

- + \ No newline at end of file diff --git a/design/index.html b/design/index.html index fb0c839f..0b90776d 100644 --- a/design/index.html +++ b/design/index.html @@ -19,7 +19,7 @@
Skip to content
- + \ No newline at end of file diff --git a/design/markdown-examples.html b/design/markdown-examples.html index d44fd9ba..63707976 100644 --- a/design/markdown-examples.html +++ b/design/markdown-examples.html @@ -51,7 +51,7 @@ ::: details This is a details block. :::

Output

INFO

This is an info box.

TIP

This is a tip.

WARNING

This is a warning.

DANGER

This is a dangerous warning.

Details

This is a details block.

More

Check out the documentation for the full list of markdown extensions.

- + \ No newline at end of file diff --git a/design/protocol.html b/design/protocol.html index e02f44a9..44591e25 100644 --- a/design/protocol.html +++ b/design/protocol.html @@ -55,7 +55,7 @@ constexpr inline static std::string_view PlainText = "plaintext"; constexpr inline static std::string_view Markdown = "markdown"; }; - + \ No newline at end of file diff --git a/feature/document-symbol.html b/feature/document-symbol.html deleted file mode 100644 index e4e5195d..00000000 --- a/feature/document-symbol.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Document Symbol | clice - - - - - - - - - - - - - - -
Skip to content

Document Symbol

Supported Case

The full cases mentioned in LSP are listed in.

In clice, the following symbols is included:

  1. Namespace

  2. Free function declaration

  3. Enum, and it's members

  4. Struct, class, add it's fields or methods.
    Abstract class is specified as Interface.

  5. Non-local and non-parameter variables
    They were specified as Constant or Variable based on their declaration.

For all above case, a deprecated tag will be added if the item is marked with [[deprecated]].

- - - - \ No newline at end of file diff --git a/feature/folding-range.html b/feature/folding-range.html deleted file mode 100644 index f4a8c067..00000000 --- a/feature/folding-range.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Folding Range | clice - - - - - - - - - - - - - - -
Skip to content

Folding Range

Supported Cases

  • condition macro
  • namespace
  • enum / struct / union declaration
  • access control block
  • funtion parameter list
  • funtion body
  • function call expression
  • compound statement
  • initialize list expression
  • lambda capture list
- - - - \ No newline at end of file diff --git a/feature/inlay-hint.html b/feature/inlay-hint.html deleted file mode 100644 index c44cf4ba..00000000 --- a/feature/inlay-hint.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Inlay Hint | clice - - - - - - - - - - - - - - -
Skip to content

Inlay Hint

Supported Case

  1. Type hint for variable declared with auto keywords in function/if/for/structure-binding.
  2. Return type hint for function/lambda body.
  3. Parameter name in function call expression.
  4. Block end hint for struct/class/enum declaration and function/lambda body.
  5. Array index for elements in initialize list expression.
  6. Value of sizeof and alignof in struct/class defination.

There is a configurable option, and some examples.

- - - - \ No newline at end of file diff --git a/feature/semantic-tokens.html b/feature/semantic-tokens.html deleted file mode 100644 index 996c9037..00000000 --- a/feature/semantic-tokens.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - clice - - - - - - - - - - - - - - -
Skip to content
- - - - \ No newline at end of file diff --git a/guide/quick-start.html b/guide/quick-start.html deleted file mode 100644 index 51b3786c..00000000 --- a/guide/quick-start.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Qucik started | clice - - - - - - - - - - - - - - -
Skip to content

Qucik started

Installation

Editor plugins

Visual Studio Code

Vim/Neovim

Others

Project setup

CMake

Bazel

Others

- - - - \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index 585d9502..c98837fe 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"build.md":"Co74jVci","configuration.md":"CpRedDOQ","contribution.md":"Zb0EHW2I","design_architecture.md":"C7gHe7F3","design_clangd.md":"Bf0uxymm","design_dependent-name.md":"CV61gbuX","design_design.md":"C2BgqDzh","design_index.md":"DRSC8Xmj","design_markdown-examples.md":"CpB9tZ0M","design_protocol.md":"DF8r9ZnS","feature_document-symbol.md":"DsqxMq4k","feature_folding-range.md":"2DTooAm1","feature_inlay-hint.md":"D7ZN-35G","feature_semantic-tokens.md":"B5B0Hwzv","guide_quick-start.md":"CwDrTxXo","index.md":"9zIdimQ1","zh_design_compilation-task.md":"CRasWF8z","zh_design_header-context.md":"JzQT9F1p","zh_design_template-resolver.md":"fGt2KNxS","zh_development_build.md":"DQ0u_rdw","zh_development_contribution.md":"VhnPZehF","zh_guide_quick-start.md":"DMOksTiB","zh_guide_roadmap.md":"BIO2ru79","zh_guide_what-is-clice.md":"C7OJIBOU","zh_index.md":"CVx52Udt"} +{"design_architecture.md":"C7gHe7F3","design_clangd.md":"Bf0uxymm","design_dependent-name.md":"CV61gbuX","design_design.md":"C2BgqDzh","design_index.md":"DRSC8Xmj","design_markdown-examples.md":"CpB9tZ0M","design_protocol.md":"DF8r9ZnS","index.md":"9zIdimQ1","zh_design_architecture.md":"CWdgG2wH","zh_design_compilation.md":"DfE77o6C","zh_design_header-context.md":"BEaf4C-z","zh_design_index.md":"DHNbht8F","zh_design_template-resolver.md":"DNGBj6oC","zh_dev_build.md":"D0ygseBD","zh_dev_contribution.md":"CtDPz8pA","zh_guide_configuration.md":"C92jpGuF","zh_guide_quick-start.md":"CcQPc5x5","zh_guide_roadmap.md":"BIO2ru79","zh_guide_what-is-clice.md":"C7OJIBOU","zh_index.md":"CVx52Udt"} diff --git a/index.html b/index.html index 28a38b4a..55697523 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@
Skip to content

cliceA complete new C++ language server

VitePress
- + \ No newline at end of file diff --git a/zh/design/architecture.html b/zh/design/architecture.html new file mode 100644 index 00000000..49206442 --- /dev/null +++ b/zh/design/architecture.html @@ -0,0 +1,25 @@ + + + + + + Architecture | clice + + + + + + + + + + + + + + +
Skip to content

Architecture

+ + + + \ No newline at end of file diff --git a/zh/design/compilation-task.html b/zh/design/compilation-task.html deleted file mode 100644 index 18d88f1f..00000000 --- a/zh/design/compilation-task.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - clice - - - - - - - - - - - - - - -
Skip to content
- - - - \ No newline at end of file diff --git a/zh/design/compilation.html b/zh/design/compilation.html new file mode 100644 index 00000000..5700ce72 --- /dev/null +++ b/zh/design/compilation.html @@ -0,0 +1,29 @@ + + + + + + Compilation | clice + + + + + + + + + + + + + + +
Skip to content

Compilation

Incremental Parsing

每当你修改代码时,clice 都必须重新解析文件。clice 使用一种叫做 preamble 的机制实现增量编译以加快重新解析速度。preamble 可被视为 Precompiled Header 的一种特殊情况(内嵌在源文件中)。在打开文件的时候,它会将文件开头的几个预处理指令(被叫做 preamble)构建成 PCH 缓存在磁盘上,后续在解析的时候则可以直接加载 PCH 文件,从而跳过前面几个预处理指令,这样可以大大减少要重新解析的代码量。

例如,对于如下的代码

cpp
#include <iostream>
+
+int main () {
+    std::cout << "Hello world!" << std::endl;
+}

iostream 这个头文件大概有 2w 行代码,clice 会先把 #include <iostream> 这一行代码构建成 PCH 文件,在完成之后在使用这个 PCH 文件来解析后面的代码。这样的话后续重新解析的代码量就只剩 5 行了,而不是原本的 2w 行,速度会变得非常快。除非你修改了 preamble 部分的代码,导致需要构建新的 preamble。

Cancel Compilation

+ + + + \ No newline at end of file diff --git a/zh/design/header-context.html b/zh/design/header-context.html index 85fd206c..d847a898 100644 --- a/zh/design/header-context.html +++ b/zh/design/header-context.html @@ -3,7 +3,7 @@ - clice + Header Context | clice @@ -13,13 +13,13 @@ - + -
Skip to content
- +
Skip to content

Header Context

+ \ No newline at end of file diff --git a/zh/design/index.html b/zh/design/index.html new file mode 100644 index 00000000..37a067b3 --- /dev/null +++ b/zh/design/index.html @@ -0,0 +1,25 @@ + + + + + + Index | clice + + + + + + + + + + + + + + +
Skip to content
+ + + + \ No newline at end of file diff --git a/zh/design/template-resolver.html b/zh/design/template-resolver.html index e93bf099..53c6ef00 100644 --- a/zh/design/template-resolver.html +++ b/zh/design/template-resolver.html @@ -3,7 +3,7 @@ - clice + Template Resolver | clice @@ -13,13 +13,13 @@ - + -
Skip to content
- +
Skip to content

Template Resolver

+ \ No newline at end of file diff --git a/zh/development/build.html b/zh/dev/build.html similarity index 60% rename from zh/development/build.html rename to zh/dev/build.html index ebc837e6..ae8dea07 100644 --- a/zh/development/build.html +++ b/zh/dev/build.html @@ -13,12 +13,12 @@ - + -
Skip to content

Supported Platforms (CI Tested)

  • Windows
  • Linux
  • MacOS

Prerequisite

本小节介绍编译 clice 的前置依赖。

Toolchain

  • clang >= 19
  • c++23 compitable standard library
    • MSVC STL >= 19.44(VS 2022 17.4)
    • GCC libstdc++ >= 14
    • Clang libc++ >= 20

clice 使用 C++23 作为语言标准 ,请确保有可用的 clang 19 以及以上的编译器,以及兼容 C++23 的标准库。

clice 暂时只能使用 clang 编译,在未来我们会改进这一点,使其能使用 gcc 和 msvc 编译。

LLVM Libs

  • 20.1.5 <= llvm libs < 21

由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST,这意味它需要链接 llvm/clang libs。另外由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。

如果你能找到系统的 llvm package 对应的 llvm commit,将该 commit 下的如下三个文件

  • clang/lib/Sema/CoroutineStmtBuilder.h
  • clang/lib/Sema/TypeLocBuilder.h
  • clang/lib/Sema/TreeTransform.h

拷贝到 LLVM_INSTALL_PATH/include/clang/Sema/ 中即可。

除了这种方法以外,还有两种办法获取 clice 所需的 llvm libs:

  1. 使用我们提供的预编译版本
bash
# .github/workflows/cmake.yml
+    
Skip to content

Supported Platforms (CI Tested)

  • Windows
  • Linux
  • MacOS

Prerequisite

本小节介绍编译 clice 的前置依赖。

Toolchain

  • clang >= 19
  • c++23 compitable standard library
    • MSVC STL >= 19.44(VS 2022 17.4)
    • GCC libstdc++ >= 14
    • Clang libc++ >= 20

clice 使用 C++23 作为语言标准 ,请确保有可用的 clang 19 以及以上的编译器,以及兼容 C++23 的标准库。

clice 暂时只能使用 clang 编译,在未来我们会改进这一点,使其能使用 gcc 和 msvc 编译。

LLVM Libs

  • 20.1.5 <= llvm libs < 21

由于 C++ 的语法太过复杂,自己编写一个新的 parser 是不现实的。clice 调用 clang 的 API 来 parse C++ 源文件获取 AST,这意味它需要链接 llvm/clang libs。另外由于 clice 使用了 clang 的私有头文件,这些私有头文件在 llvm 发布的 binary release 中是没有的,所以不能直接使用系统的 llvm package。

如果你能找到系统的 llvm package 对应的 llvm commit,将该 commit 下的如下三个文件

  • clang/lib/Sema/CoroutineStmtBuilder.h
  • clang/lib/Sema/TypeLocBuilder.h
  • clang/lib/Sema/TreeTransform.h

拷贝到 LLVM_INSTALL_PATH/include/clang/Sema/ 中即可。

除了这种方法以外,还有两种办法获取 clice 所需的 llvm libs:

  1. 使用我们提供的预编译版本
bash
# .github/workflows/cmake.yml
 
 # Linux precompiled binary require glibc 2.35 (build on ubuntu 22.04)
 $ mkdir -p ./.llvm
@@ -36,7 +36,7 @@
 $ xmake build --all

--llvm 是可选的,如果不指定的话,xmake 会自动下载我们编译好的预编译二进制

Run Tests

clice 有两种形式的测试,单元测试和集成测试。

  • 运行单元测试
bash
$ ./build/bin/unit_tests --test-dir="./tests/data" --resource-dir="<LLVM_INSTALL_PATH>/lib/clang/20"
  • 运行集成测试
bash
$ pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice --resource-dir="<LLVM_INSTALL_PATH>/lib/clang/20"

resource-dir 是 clang 的内置头文件文件夹

或者,如果你使用 xmake 作为构建系统,可以直接通过 xmake 运行测试

shell
$ xmake test --verbose
 $ xmake run unit_tests --verbose
 $ xmake test integration_tests/default --verbose
- + \ No newline at end of file diff --git a/zh/dev/contribution.html b/zh/dev/contribution.html new file mode 100644 index 00000000..2469f15d --- /dev/null +++ b/zh/dev/contribution.html @@ -0,0 +1,25 @@ + + + + + + Contribution | clice + + + + + + + + + + + + + + +
Skip to content

Contribution

我们欢迎任何贡献!

+ + + + \ No newline at end of file diff --git a/zh/development/contribution.html b/zh/development/contribution.html deleted file mode 100644 index 1523964c..00000000 --- a/zh/development/contribution.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Contribution | clice - - - - - - - - - - - - - - -
Skip to content

Contribution

- - - - \ No newline at end of file diff --git a/configuration.html b/zh/guide/configuration.html similarity index 63% rename from configuration.html rename to zh/guide/configuration.html index 29c3db53..a5d68c5c 100644 --- a/configuration.html +++ b/zh/guide/configuration.html @@ -13,12 +13,12 @@ - + -
Skip to content

Configuration

This is the document of

Server

NameTypeDefault
server.moduleSupportbooleanfalse

Whether to enable module support.

NameTypeDefault
server.overSearchbooleantrue
  • false: Limits the symbol search scope to files connected through the include graph, which is efficient but does not handle symbols defined independently in other files.

For example:

cpp
/// a.h
+    
Skip to content

Configuration

This is the document of

Server

NameTypeDefault
server.moduleSupportbooleanfalse

Whether to enable module support.

NameTypeDefault
server.overSearchbooleantrue
  • false: Limits the symbol search scope to files connected through the include graph, which is efficient but does not handle symbols defined independently in other files.

For example:

cpp
/// a.h
 struct Foo {};
 
 /// b.cpp
@@ -54,7 +54,7 @@
     {"from": "const", "to": "readonly"},
     {"from": "pureVirtual", "to": "abstract"},
 ]

For all clice symbol kinds, please refer to SymbolKind. The first letter of the name should be translated to lowercase. For all LSP semantic token types, refer to SemanticTokenKind.

NameTypeDefault
feature.semanticTokens.standardbooleanfalse

If true, clice will map the semantic token types and modifiers to the standard ones automatically.

Folding Range

- + \ No newline at end of file diff --git a/zh/guide/quick-start.html b/zh/guide/quick-start.html index 43e4672c..2e6854c7 100644 --- a/zh/guide/quick-start.html +++ b/zh/guide/quick-start.html @@ -13,13 +13,13 @@ - + -
Skip to content

Quick Start

Editor Plugins

clice 实现了 Language Server Protocol,任何支持该协议的编辑器原则上均可以与 clice 一起使用,提供像 code completion, diagnostics, go-to-definition, 等等。

但是除了标准协议之外,clice 还支持一些协议扩展,为了更好的处理这些协议扩展以及更好的与编辑器集成。使用特定编辑器中的 clice 插件往往是更好的选择,它们大多数都是开箱即用的,并且支持 clice 的协议扩展。

Visual Studio Code

Vim/Neovim

Others

其它的编辑器还没有可用的 clice 插件(欢迎贡献!),为了在它们中使用 clice,请自行安装 clice 并参考特定编辑器的文档关于如何使用一个语言服务器。

Installation

如果你的编辑器插件负责了 clice 的下载,可以跳过这一步。

Download Prebuilt Binary

通过 Release 界面下载 clice 二进制版本。

Build from Source

自己从源码编译 clice,具体的步骤参考 build

Project Setup

为了让 clice 能正确理解你的代码(例如找到头文件的位置),需要为 clice 提供一份 compile_commands.json 文件,也就说所谓的 编译数据库。编译数据库中提供了每个源文件的编译选项。

CMake

对于使用 cmake 的构建系统来说,在构建的时候添加 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 选项即可,例如

cmake
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

这会在 build 目录下生成一份 compile_commands.json 文件。

WARNING

注意:只有当 cmake 的生成器选择为 makefile 和 ninja 的时候,这个选项才有作用。对于其它生成器会忽略这个选项,也就是说无法生成编译数据库。

Bazel

TODO:

Visual Studio

TODO:

Makefile

TODO:

Xmake

Others

对于任意其它的构建系统,可以尝试使用 bear 或者 scan-build 来拦截编译命令并获取到编译数据库(不保证成功)。我们计划在未来编写一个新的工具,通过假编译器的方式来实现编译命令的捕获。

- +
Skip to content

Quick Start

Editor Plugins

clice 实现了 Language Server Protocol,任何支持该协议的编辑器原则上均可以与 clice 一起使用,提供像 code completion, diagnostics, go-to-definition, 等等。

但是除了标准协议之外,clice 还支持一些协议扩展,为了更好的处理这些协议扩展以及更好的与编辑器集成。使用特定编辑器中的 clice 插件往往是更好的选择,它们大多数都是开箱即用的,并且支持 clice 的协议扩展。

Visual Studio Code

Vim/Neovim

Others

其它的编辑器还没有可用的 clice 插件(欢迎贡献!),为了在它们中使用 clice,请自行安装 clice 并参考特定编辑器的文档关于如何使用一个语言服务器。

Installation

如果你的编辑器插件负责了 clice 的下载,可以跳过这一步。

Download Prebuilt Binary

通过 Release 界面下载 clice 二进制版本。

Build from Source

自己从源码编译 clice,具体的步骤参考 build

Project Setup

为了让 clice 能正确理解你的代码(例如找到头文件的位置),需要为 clice 提供一份 compile_commands.json 文件,也就说所谓的 编译数据库。编译数据库中提供了每个源文件的编译选项。

CMake

对于使用 cmake 的构建系统来说,在构建的时候添加 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 选项即可,例如

cmake
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

这会在 build 目录下生成一份 compile_commands.json 文件。

WARNING

注意:只有当 cmake 的生成器选择为 makefile 和 ninja 的时候,这个选项才有作用。对于其它生成器会忽略这个选项,也就是说无法生成编译数据库。

Bazel

TODO:

Visual Studio

TODO:

Makefile

TODO:

Xmake

Others

对于任意其它的构建系统,可以尝试使用 bear 或者 scan-build 来拦截编译命令并获取到编译数据库(不保证成功)。我们计划在未来编写一个新的工具,通过假编译器的方式来实现编译命令的捕获。

+ \ No newline at end of file diff --git a/zh/guide/roadmap.html b/zh/guide/roadmap.html index 4917cbc9..41779627 100644 --- a/zh/guide/roadmap.html +++ b/zh/guide/roadmap.html @@ -19,7 +19,7 @@
Skip to content
- + \ No newline at end of file diff --git a/zh/guide/what-is-clice.html b/zh/guide/what-is-clice.html index f6a0396c..ad752c1f 100644 --- a/zh/guide/what-is-clice.html +++ b/zh/guide/what-is-clice.html @@ -19,7 +19,7 @@
Skip to content

clice 是一个全新的 C++ 的语言服务器,旨在解决现存 C++ 语言服务器的不足,它可以为你的编辑器提供代码导航和智能提示等服务。

- + \ No newline at end of file diff --git a/zh/index.html b/zh/index.html index 13bc346c..c0122c2d 100644 --- a/zh/index.html +++ b/zh/index.html @@ -19,7 +19,7 @@
Skip to content

clice下一代 C++ 语言服务器

开发正在活跃进行中

clice
- + \ No newline at end of file