From 329a4ff63951fb04fac95b98dd0f3b04ba42d8bc Mon Sep 17 00:00:00 2001 From: clice-bot <306533837+clice-bot@users.noreply.github.com> Date: Sun, 23 Aug 2026 12:03:09 +0000 Subject: [PATCH] docs: sync clice --- en/clice/features/completion.md | 12 ++ en/clice/features/document-links.md | 189 +++++++++++++++++++++++++--- en/clice/features/overview.md | 45 ++++--- 3 files changed, 214 insertions(+), 32 deletions(-) diff --git a/en/clice/features/completion.md b/en/clice/features/completion.md index a24eae39..847a2502 100644 --- a/en/clice/features/completion.md +++ b/en/clice/features/completion.md @@ -105,10 +105,22 @@ Triggered when cursor is after `import` or `export import`.
Example + `main.cpp`: + ```cpp import ma ``` + `mod_math.cppm`: + + ```cpp + export module math; + + export int add(int a, int b) { + return a + b; + } + ``` +
diff --git a/en/clice/features/document-links.md b/en/clice/features/document-links.md index 96ff0dbf..3dfff863 100644 --- a/en/clice/features/document-links.md +++ b/en/clice/features/document-links.md @@ -2,42 +2,195 @@ Clickable links from source directives to their resolved target files. -> **Known limitation**: link targets are currently emitted as raw filesystem paths instead of `file:///` URIs. Clients that strictly validate DocumentUri may not navigate these links. + ## Include Directives -- [x] `#include "..."` — link to resolved header file -- [x] `#include <...>` — link to resolved system header -- [x] `__has_include(...)` — link to checked file -- [x] `#embed "..."` — link to embedded resource file -- [x] `__has_embed(...)` — link to checked embed file -- [x] `#include_next` — link to the resolved next-in-search-path header -- [x] Macro-expanded include paths — resolve and link when the path is produced by a macro ([clangd#2375](https://github.com/clangd/clangd/issues/2375)) + + +- [x] Quoted includes — `#include "..."` links to the resolved header file + + Every include in the file is linked, not just the preamble run at + the top. + +
+ Example + + ```cpp + #include "header_a.h" + #include "header_b.h" + int x = 1; + #include "header_c.h" + ``` + +
+ +- [x] Angle-bracket includes — `#include <...>` links to the header found on the search path + +
+ Example + + ```cpp + #include + ``` + +
+ +- [x] Macro-expanded paths — `#include MACRO` links the directive argument to the expanded target ([clangd#2375](https://github.com/clangd/clangd/issues/2375)) + +
+ Example + + ```cpp + #define HEADER "header_b.h" + #include HEADER + ``` + +
+ +- [ ] `#include_next` and `__has_include_next` — links continue down the search path _(partial)_ + + `first/wrap.h` shadows `second/wrap.h` on the search path; its + `#include_next` (guarded by `__has_include_next`) includes the second + copy. Next-in-path resolution only exists when the header is compiled + in an including TU's context — opened standalone it is compiled as its + own TU, where clang deliberately treats `#include_next` as a plain + include, so today both links land back on the first copy (as the + snapshot pins). + +
+ Example + + `main.cpp`: + + ```cpp + #include + + int use_wrap = WRAP_FIRST + WRAP_SECOND; + ``` + + `first/wrap.h`: + + ```cpp + #pragma once + + #define WRAP_FIRST 1 + + #if __has_include_next() + #include_next + #endif + ``` + + `second/wrap.h`: + + ```cpp + #pragma once + + #define WRAP_SECOND 2 + ``` + +
+ +- [x] `__has_include` — the checked path links to the file it probes + +
+ Example + + ```cpp + #if __has_include("header_c.h") + #include "header_c.h" + #endif + ``` + +
+ + + +## Embed Directives + + + +- [x] `#embed` — the resource path links to the embedded file + +
+ Example ```cpp - #define HEADER "config.h" - #include HEADER // should link to config.h + const char data[] = { + #embed "data.bin" + }; ``` -- [x] `__has_include_next(...)` — link to checked file -- [ ] Show resolved absolute path as tooltip +
+- [x] `__has_embed` — the checked path links to the probed resource + +
+ Example + + ```cpp + #if __has_embed("data.bin") + const char first_byte[] = { + #embed "data.bin" limit(1) + }; + #endif ``` - #include - // tooltip: /usr/include/c++/14/vector + +
+ + + +## Presentation + + + +- [x] Resolved-path tooltips — every link carries its target's absolute path as the hover tooltip + + Editors render the tooltip next to the follow-link hint, e.g. + `/usr/include/c++/14/vector (ctrl + click)`. Snapshots pin only the + link targets; the suite instead validates the tooltip against the + target on the server reply of every fixture in this corpus. + +
+ Example + + ```cpp + #include "header_a.h" ``` +
+ + + ## Module Declarations -- [ ] `import module_name;` — link to module interface file -- [ ] `import :partition;` — link to partition file -- [ ] `module module_name;` — link to module interface (from implementation unit) -- [ ] `export import module_name;` — link to re-exported module interface + + +- [ ] Module targets — `import` and `module` declarations link to their interface files + +
+ Example + + ```cpp + export module app; + + import lib; + import :part; + export import lib.extra; + ``` + +
+ + ## Changelog | Date | Change | PR | | ---------- | ------------------------------------------------------------- | -------------------------------------------------- | +| 2026-08-23 | Resolved-path tooltips; replies sorted into document order | [#632](https://github.com/clice-io/clice/pull/632) | | 2026-04-11 | `__has_include` argument links via unified directive scanning | [#421](https://github.com/clice-io/clice/pull/421) | | 2026-04-09 | `#embed` links; links inside the preamble preserved | [#413](https://github.com/clice-io/clice/pull/413) | | 2025-03-16 | `#include` directive links | [#107](https://github.com/clice-io/clice/pull/107) | diff --git a/en/clice/features/overview.md b/en/clice/features/overview.md index c34b87aa..a943494e 100644 --- a/en/clice/features/overview.md +++ b/en/clice/features/overview.md @@ -6,20 +6,29 @@ clice provides a suite of C++ development tools built on LLVM/Clang. This sectio Language Server Protocol features available when using clice as an editor backend. -| Feature | Status | Page | -| ---------------- | ----------- | ----------------------------------------- | -| Code Completion | Partial | [completion](./completion.md) | -| Hover | Implemented | [hover](./hover.md) | -| Signature Help | Implemented | [signature-help](./signature-help.md) | -| Go to Definition | Partial | [navigation](./navigation.md) | -| Document Links | Partial | [document-links](./document-links.md) | -| Semantic Tokens | Implemented | [semantic-tokens](./semantic-tokens.md) | -| Inlay Hints | Implemented | [inlay-hints](./inlay-hints.md) | -| Folding Ranges | Implemented | [folding-ranges](./folding-ranges.md) | -| Document Symbols | Implemented | [document-symbols](./document-symbols.md) | -| Formatting | Implemented | [formatting](./formatting.md) | -| Diagnostics | Partial | [diagnostics](./diagnostics.md) | -| Code Action | Stub | [code-action](./code-action.md) | + + + + +| Feature | Status | Page | +| ---------------- | ----------------------------------------- | ----------------------------------------- | +| Code Completion | 30 supported | [completion](./completion.md) | +| Hover | Implemented | [hover](./hover.md) | +| Signature Help | 14 supported | [signature-help](./signature-help.md) | +| Code Navigation | Partial | [navigation](./navigation.md) | +| Document Links | 7 supported · 1 partial · 1 unsupported | [document-links](./document-links.md) | +| Semantic Tokens | 52 supported · 4 partial · 10 unsupported | [semantic-tokens](./semantic-tokens.md) | +| Inlay Hints | 31 supported · 6 partial · 4 unsupported | [inlay-hints](./inlay-hints.md) | +| Folding Ranges | 13 supported · 2 partial · 6 unsupported | [folding-ranges](./folding-ranges.md) | +| Document Symbols | 18 supported · 2 partial · 7 unsupported | [document-symbols](./document-symbols.md) | +| Formatting | Implemented | [formatting](./formatting.md) | +| Diagnostics | Partial | [diagnostics](./diagnostics.md) | +| Code Action | Stub | [code-action](./code-action.md) | + + ## Lint @@ -31,6 +40,14 @@ Project-wide static analysis powered by clang-tidy, with cross-TU optimizations ## Legend +Fixture-backed features count the documented capabilities their test corpus pins at each status: + +- **supported** — the capability works; a snapshot pins the behavior +- **partial** — incomplete; the snapshot pins what works today +- **unsupported** — a documented gap, tracked but not yet implemented + +Features not yet on the fixture pipeline keep a hand-assigned label: + - **Implemented** — core functionality working, minor gaps only - **Partial** — key subsystems missing (e.g., module support) - **Stub** — handler exists but returns empty/null