Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bc19996
fix(server): rebuild header context synthesis and invalidation
16bit-ykiko Jul 3, 2026
7453016
feat(server): build header context PCH and share PCH by content key
16bit-ykiko Jul 3, 2026
9e3953a
feat(server): complete compilation context protocol
16bit-ykiko Jul 3, 2026
956cdba
feat(server): automatic self-containment detection for headers
16bit-ykiko Jul 3, 2026
a4a8d12
feat(vscode): compilation context status bar and switcher
16bit-ykiko Jul 3, 2026
ee9ae9c
fix(server): address review findings on compilation context
16bit-ykiko Jul 3, 2026
d25315d
test(editors): exercise compilation context requests in vscode E2E
16bit-ykiko Jul 3, 2026
5991caf
test(editors): make definition scenario-optional in E2E
16bit-ykiko Jul 3, 2026
fffff04
docs: detail the Inferred tier strategies
16bit-ykiko Jul 3, 2026
307bdd3
fix(server): skip PCH for prefix-less header contexts
16bit-ykiko Jul 3, 2026
ef394b5
chore(vscode): fill in allowBuilds placeholders
16bit-ykiko Jul 3, 2026
33db73f
chore(vscode): stop F5 depending on a third-party problem matcher
16bit-ykiko Jul 3, 2026
c05ab8e
fix(server): don't report termination signals as worker crashes
16bit-ykiko Jul 3, 2026
80c8415
feat(vscode): restore the compilation contexts tree view
16bit-ykiko Jul 3, 2026
3413874
chore(vscode): formatting
16bit-ykiko Jul 3, 2026
f1b9956
fix(server): keep documentLink valid when the PCH has no links
16bit-ykiko Jul 3, 2026
b886f2e
feat(server): epoch validation for context listings
16bit-ykiko Jul 3, 2026
662795a
feat(vscode): epoch-checked switching and C++ fragment detection
16bit-ykiko Jul 3, 2026
241e5b2
feat(server): push inactive preprocessor regions
16bit-ykiko Jul 3, 2026
4e2b639
feat(server): suffix injection restores post-include context
16bit-ykiko Jul 3, 2026
744a4e7
fix(server): compile synthesized artifacts with their host command
16bit-ykiko Jul 3, 2026
cc0fd30
fix(server): don't use SIGHUP macro, absent on Windows
16bit-ykiko Jul 3, 2026
feb40a7
fix(server): make inactive regions reach the client
16bit-ykiko Jul 3, 2026
db8e516
fix(support): cache store survives external wipes
16bit-ykiko Jul 3, 2026
e4a77ad
feat(vscode): protocol-aligned context commands
16bit-ykiko Jul 3, 2026
5e1ef04
fix(server): address Codex review findings on compilation contexts
16bit-ykiko Jul 3, 2026
e668a22
fix(server): address second-round Codex review findings
16bit-ykiko Jul 4, 2026
9c733c5
fix(server): address third-round Codex review findings
16bit-ykiko Jul 4, 2026
a00953c
fix(server): address fourth-round Codex review findings
16bit-ykiko Jul 4, 2026
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
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"CLICE_MODE": "pipe"
},
"outFiles": ["${workspaceFolder}/editors/vscode/dist/**/*.js"],
"preLaunchTask": "npm: watch vscode ext"
"preLaunchTask": "npm: compile vscode ext"
},
{
"name": "VSCode Extension (socket)",
Expand All @@ -47,7 +47,7 @@
"CLICE_MODE": "socket"
},
"outFiles": ["${workspaceFolder}/editors/vscode/dist/**/*.js"],
"preLaunchTask": "npm: watch vscode ext"
"preLaunchTask": "npm: compile vscode ext"
},
{
"type": "lldb",
Expand Down
11 changes: 11 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
},
"problemMatcher": []
},
{
"label": "npm: compile vscode ext",
"type": "shell",
"command": "pnpm",
"args": ["run", "compile"],
"options": {
"cwd": "${workspaceFolder}/editors/vscode"
},
"dependsOn": "npm: install vscode deps",
"problemMatcher": []
},
{
"label": "npm: watch vscode ext",
"type": "shell",
Expand Down
73 changes: 31 additions & 42 deletions docs/en/design/compilation-context.md

Large diffs are not rendered by default.

73 changes: 31 additions & 42 deletions docs/zh/design/compilation-context.md

Large diffs are not rendered by default.

39 changes: 24 additions & 15 deletions editors/nvim/tests/e2e.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ local scenarios = {
index_symbol = 'magic_number',
definition_file = 'defs.cppm',
},
header_context = {
file = 'utils.h',
symbol = 'distance(p',
index_symbol = 'calc',
-- no definition_file: cross-file definition into headers is a
-- known index gap.
},
}

local scenario = scenarios[vim.fs.basename(fixture_dir)]
Expand Down Expand Up @@ -149,21 +156,23 @@ if not hover or not hover.contents then
fail 'hover returned no contents'
end

step 'definition'
local definition = request('textDocument/definition', {
textDocument = text_document,
position = position,
})
if definition and definition.uri then
definition = { definition }
end
if not definition or #definition == 0 then
fail 'definition returned no locations'
end
local target = definition[1].uri or definition[1].targetUri
local target_file = vim.fs.basename(vim.uri_to_fname(target))
if target_file ~= scenario.definition_file then
fail('definition landed in ' .. target_file .. ', expected ' .. scenario.definition_file)
if scenario.definition_file then
step 'definition'
local definition = request('textDocument/definition', {
textDocument = text_document,
position = position,
})
if definition and definition.uri then
definition = { definition }
end
if not definition or #definition == 0 then
fail 'definition returned no locations'
end
local target = definition[1].uri or definition[1].targetUri
local target_file = vim.fs.basename(vim.uri_to_fname(target))
if target_file ~= scenario.definition_file then
fail('definition landed in ' .. target_file .. ', expected ' .. scenario.definition_file)
end
end

step 'completion'
Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/.vscode-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../
// Each fixture under tests/data becomes one test run with that workspace.
// Run tests/prepare.py first to generate compile databases.
// Keep in sync with the editor tasks in pixi.toml.
const fixtures = ["hello_world", "modules/hover_on_imported_symbol"];
const fixtures = ["hello_world", "modules/hover_on_imported_symbol", "header_context"];

export default defineConfig(
fixtures.map((fixture) => ({
Expand Down
86 changes: 84 additions & 2 deletions editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"activationEvents": [
"onLanguage:c",
"onLanguage:cpp",
"onLanguage:cuda-cpp"
"onLanguage:cuda-cpp",
"onStartupFinished"
],
"contributes": {
"configuration": {
Expand Down Expand Up @@ -66,6 +67,31 @@
{
"command": "clice.restart",
"title": "Clice: Restart Language Server"
},
{
"command": "clice.switchContext",
"title": "Clice: Switch Compilation Context"
},
{
"command": "clice.showCurrentContext",
"title": "Clice: Show Current Compilation Context"
},
{
"command": "clice.queryContexts",
"title": "Clice: Query Compilation Contexts"
},
{
"command": "clice.refreshContexts",
"title": "Clice: Refresh Compilation Contexts",
"icon": "$(refresh)"
},
{
"command": "clice.applyContext",
"title": "Clice: Apply Compilation Context"
},
{
"command": "clice.loadMoreContexts",
"title": "Clice: Load More Compilation Contexts"
}
],
"semanticTokenTypes": [
Expand Down Expand Up @@ -139,7 +165,63 @@
"description": "Angle brackets `<>`",
"superType": "operator"
}
]
],
"views": {
"explorer": [
{
"id": "clice.contexts",
"name": "Compilation Contexts",
"when": "editorLangId == c || editorLangId == cpp || editorLangId == cuda-cpp"
}
]
},
"menus": {
"commandPalette": [
{
"command": "clice.applyContext",
"when": "false"
},
{
"command": "clice.loadMoreContexts",
"when": "false"
},
{
"command": "clice.refreshContexts",
"when": "false"
},
{
"command": "clice.switchContext",
"when": "editorLangId == c || editorLangId == cpp || editorLangId == cuda-cpp"
},
{
"command": "clice.showCurrentContext",
"when": "editorLangId == c || editorLangId == cpp || editorLangId == cuda-cpp"
},
{
"command": "clice.queryContexts",
"when": "editorLangId == c || editorLangId == cpp || editorLangId == cuda-cpp"
}
],
"editor/context": [
{
"command": "clice.switchContext",
"when": "editorLangId == c || editorLangId == cpp || editorLangId == cuda-cpp",
"group": "clice@1"
},
{
"command": "clice.showCurrentContext",
"when": "editorLangId == c || editorLangId == cpp || editorLangId == cuda-cpp",
"group": "clice@2"
}
],
"view/title": [
{
"command": "clice.refreshContexts",
"when": "view == clice.contexts",
"group": "navigation"
}
]
}
},
"main": "./dist/extension.js",
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions editors/vscode/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
onlyBuiltDependencies:
- "@vscode/vsce-sign"
- keytar
# vsce-sign (marketplace signing) and keytar (credential store) are vsce
# transitive deps; their build scripts are not needed for local dev or CI.
allowBuilds:
"@vscode/vsce-sign": false
keytar: false
8 changes: 8 additions & 0 deletions editors/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
} from "vscode-languageclient/node";
import { getSetting } from "./setting";
import { ensureServerBinary } from "./download";
import { registerCompilationContext } from "./feature/context";
import { registerInactiveRegions } from "./feature/inactive";

let client: LanguageClient;

Expand Down Expand Up @@ -84,6 +86,12 @@ export async function activate(context: ExtensionContext) {
await registerCommands(client, context);

await client.start();

registerCompilationContext(client, context);
registerInactiveRegions(client, context);

// Exposed for E2E tests to exercise custom requests directly.
return { client };
}

export function deactivate(): Thenable<void> | undefined {
Expand Down
Loading
Loading