Repository navigation
0.0.16: clangd checks a file once typing pauses, an unchanged build input is no change, a module that failed in an import is named, build.mcpp beside the mcpp extension - #58
Merged
Conversation
…nput is no change, a module that failed in an import is named, build.mcpp beside the mcpp extension Typing. clangd builds the file at every key: its own debounce follows its build time, about a person's pace between keys, and VS Code's semantic tokens, highlights, code actions and hints after each edit make it build the latest version anyway. The clangd engine now gives each version of a file being typed in with `wantDiagnostics: false`, holds the requests that build the file (the latest of each kind; a replaced one is answered ContentModified) and, once the keys stop for 0.3-1 s (a little longer than the file's last build), asks for the latest version again with diagnostics. Build programs and module units, and a change that leaves the text as it was, go as before. mcppls.engine.diagnosticsWhileTyping: auto (default) or always. On a Qt + import std file: 16 builds to 3, clangd CPU -43%. Fixture typing-pause. Idle. mcpp rewrites the lock of a build program's synthesised package on every run and lists it in data.watch (mcpp-community/mcpp#807), so a project with build.mcpp was described again every two seconds. A build file or producer input that holds the bytes the last description read is no change, whether changed or created; deleted always is. A prefetch that came back empty is not asked again until a file or the plan changes. Fixture mcpp-emit-watch W0 (mockmcpp rewriteEachRun), both watch paths. Failed modules. clang begins an error in an imported module or file with "In module 'M' imported from <unit>:<line>:" or "In file included from <unit>:<line>:"; the first <unit> is the one that failed, where mcppls took the file of the error and dropped the failure. A failure whose unit the plan does not name is still said on its importer, and a missing BMI with no known reason says so instead of "module file not found". Fixture module-fails-in-import. build.mcpp. The client also selects **/*.mcpp, whatever language another extension gives it, and the server treats it as C++; the extension API has otherCppFeatures() for mcpp-vscode's "other C++ language services" row. Plan: .agents/docs/2026-10-14-cross-repo-build-mcpp-and-typing-cpu-plan.md
…is cleared without from_range, build inputs are keyed by path key; plan: the mcpp-plugins record and the deviations
…oml, since an unchanged write is no change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of a cross-repository plan (
.agents/docs/2026-10-14-cross-repo-build-mcpp-and-typing-cpu-plan.md) with mcpp-community/mcpp-vscode#18 and mcpp-community/mcpp-plugins#47, both merged.What changes
Typing (A4). clangd built the file at every key: its debounce follows its build time, which is about a person's pace between keys, and VS Code's semantic tokens / highlights / code actions / hints after each edit force a build of the latest version anyway. The clangd engine now sends each version of a file being typed in with
wantDiagnostics: false, holds the requests that build the file (the latest of each kind; replaced ones answeredContentModified), and once the keys stop forclamp(1.2 x last build, 300 ms, 1 s)sends the same version with emptycontentChangesandwantDiagnostics: true. Build programs, module units and a change that leaves the text unchanged are not held. Settingmcppls.engine.diagnosticsWhileTyping(autodefault,always= 0.0.15).wantDiagnostics: falsepublishes nothing; the same-version empty change withtruepublishes the latest text's diagnostics, also when a request already built the AST.import std+import nlohmann.json, typingstd::vec, delete,arr, delete,finat 200 ms with VS Code's request mix, 3 rounds): clangd CPU 5.23-5.36 s -> 2.90-3.06 s (-43%), BuildAST 16 -> 3, semanticTokens builds 14 -> 1.typing-pause(all four platforms): 0 publications during 21 keys (0.0.15: 15), the latest version diagnosed within 5 s, the last semanticTokens answered with tokens.Idle (A1, A2). mcpp rewrites the lock of a build program's synthesised package on every run and lists it in
data.watch(mcpp-community/mcpp#807): with abuild.mcpp, the project was described every 2 s of an idle session. A build file or producer input holding the bytes the last description read is now no change (changed or created; deleted always counts).mcpp-emit-watchgains W0 (mockmcpprewriteEachRun), passing on both watch paths; 0.0.15 fails both. A prefetch that came back empty is not asked again until a file or the plan changes (test_answer).Failed modules (A3). An error inside an imported module or file starts
In module 'M' imported from <unit>:<line>:/In file included from <unit>:<line>:; the first<unit>is the failed one. The importer now getsmodule-failedwith the reason; a failure whose unit no plan names is still said on the importer; a hint BMI that was never built says so. Unit tests with real log lines (anonymised, incl. Windows nesting) and fixturemodule-fails-in-import(0.0.15:ast_file_not_found).build.mcpp beside mcpp-vscode (A6). The client also selects
**/*.mcpp, so an extension that givesbuild.mcppits own language id (mcpp-vscode <= 0.6.0) no longer keeps it from mcppls; the server treats.mcppas C++. The extension API gainsotherCppFeatures()({ active: [{ extensionId, displayName, settable }], canRestore }), asserted insuite-conflicts.Checked locally
mcpp test(38/38),devtools check all,npm run compile, unit tests (129), and conformance: the new fixtures plus typing-autosave, typing-import, typing-import-spin, module-edit-autosave, module-faults, build-program-*, mcpp-emit-watch (both watch paths), inferred.