Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions en/clice/features/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,22 @@ Triggered when cursor is after `import` or `export import`.
<details>
<summary>Example</summary>

`main.cpp`:

```cpp
import ma
```

`mod_math.cppm`:

```cpp
export module math;

export int add(int a, int b) {
return a + b;
}
```

</details>

<!-- END GENERATED ITEMS -->
Expand Down
189 changes: 171 additions & 18 deletions en/clice/features/document-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<!-- The checklist sections below are generated from the snapshot fixtures in
tests/snap/document_links/. Do not edit the regions between the GENERATED
markers by hand — edit the fixture doc headers and run
`node tools/feature_docs.ts update`. -->

## 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))
<!-- BEGIN GENERATED ITEMS: Include Directives -->

- [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.

<details>
<summary>Example</summary>

```cpp
#include "header_a.h"
#include "header_b.h"
int x = 1;
#include "header_c.h"
```

</details>

- [x] Angle-bracket includes — `#include <...>` links to the header found on the search path

<details>
<summary>Example</summary>

```cpp
#include <header_a.h>
```

</details>

- [x] Macro-expanded paths — `#include MACRO` links the directive argument to the expanded target ([clangd#2375](https://github.com/clangd/clangd/issues/2375))

<details>
<summary>Example</summary>

```cpp
#define HEADER "header_b.h"
#include HEADER
```

</details>

- [ ] `#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).

<details>
<summary>Example</summary>

`main.cpp`:

```cpp
#include <wrap.h>

int use_wrap = WRAP_FIRST + WRAP_SECOND;
```

`first/wrap.h`:

```cpp
#pragma once

#define WRAP_FIRST 1

#if __has_include_next(<wrap.h>)
#include_next <wrap.h>
#endif
```

`second/wrap.h`:

```cpp
#pragma once

#define WRAP_SECOND 2
```

</details>

- [x] `__has_include` — the checked path links to the file it probes

<details>
<summary>Example</summary>

```cpp
#if __has_include("header_c.h")
#include "header_c.h"
#endif
```

</details>

<!-- END GENERATED ITEMS -->

## Embed Directives

<!-- BEGIN GENERATED ITEMS: Embed Directives -->

- [x] `#embed` — the resource path links to the embedded file

<details>
<summary>Example</summary>

```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
</details>

- [x] `__has_embed` — the checked path links to the probed resource

<details>
<summary>Example</summary>

```cpp
#if __has_embed("data.bin")
const char first_byte[] = {
#embed "data.bin" limit(1)
};
#endif
```
#include <vector>
// tooltip: /usr/include/c++/14/vector

</details>

<!-- END GENERATED ITEMS -->

## Presentation

<!-- BEGIN GENERATED ITEMS: 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.

<details>
<summary>Example</summary>

```cpp
#include "header_a.h"
```

</details>

<!-- END GENERATED ITEMS -->

## 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
<!-- BEGIN GENERATED ITEMS: Module Declarations -->

- [ ] Module targets — `import` and `module` declarations link to their interface files

<details>
<summary>Example</summary>

```cpp
export module app;

import lib;
import :part;
export import lib.extra;
```

</details>

<!-- END GENERATED ITEMS -->

## 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) |
45 changes: 31 additions & 14 deletions en/clice/features/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
<!-- The status matrix is generated from the snapshot fixtures under
tests/snap/. Do not edit the region between the GENERATED markers by
hand — edit the fixtures (or OVERVIEW_ROWS in tools/feature_docs.ts)
and run `node tools/feature_docs.ts update`. -->

<!-- BEGIN GENERATED OVERVIEW -->

| 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) |

<!-- END GENERATED OVERVIEW -->

## Lint

Expand All @@ -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
Expand Down
Loading