Development and Release
This page targets maintainers: how to develop locally, debug, build the docs, and control the versioning policy.
Requirements
- Node.js
^20.19.0 || >=22.12.0(prefer the version pinned in.nvmrc) - pnpm: defer to the
packageManagerfield inpackage.json(currently pnpm 12.10.1) - VSCode 1.82.0 or newer — see the runtime matrix below for why this is the floor
VS Code Runtime Matrix (REL-005)
The minimum supported VS Code is 1.82 (engines.vscode: ^1.82.0). This is derived, not inherited:
| Constraint | Floor | Basis |
|---|---|---|
languages.registerInlayHintsProvider (type-stub inlays) | 1.66 | stable API since 1.66; pinning @types/vscode to 1.82.0 makes tsc verify every API we use is ≤1.82 |
vscode.tests.createTestController + TestRun.appendOutput | 1.59 / 1.61 | test-tree and output faces (IDE-TSK-005) |
workspace.onDidRenameFiles/onDidDeleteFiles, workspace.fs | 1.33 / 1.34 | file events and virtual FS |
esbuild --target=node18 bundles (out/extension.js, out/pythonParserWorker.js) | 1.82 | VS Code 1.82+ embeds Node 18.15 (Electron 25); per the vscode-versions mapping (Node 16→1.80, Node 18→1.82, Node 20→1.90) |
The binding floor is 1.82 (the Node runtime beats the API floor). Guards in tests/runtimeMatrix.test.ts keep three declarations in sync: engines.vscode ≥1.82, @types/vscode pinned to the same major.minor as engines.vscode (so a floating types package cannot hide an out-of-matrix API), and every --target=nodeN in the bundle script mapped to its minimum VS Code. Raising the bundle target later (e.g. to Node 20) fails the guard until engines.vscode moves to ≥1.90.
Local Development
pnpm install
pnpm run watch
code .Then press F5 in VSCode to start the Extension Development Host.
Common Scripts
pnpm run compile
pnpm run watch
pnpm run lint
pnpm test
pnpm run docs:dev
pnpm run docs:build
pnpm run packageChanged Code Has No Effect? Check Which Build VS Code Runs
Most "my change did nothing" reports are stale artifacts, not logic bugs. Check in order:
- Installed extension:
%USERPROFILE%\.vscode\extensionsmust contain acuihairu.kode-kbengine-*folder (the extension id was renamed fromkodetokode-kbengine, and the last segment follows the version); if it is absent, the extension is not installed and you are not testing this code.powershellGet-ChildItem $env:USERPROFILE\.vscode\extensions -Filter '*kode*' - Extension Development Host (F5) artifact: the entry point is
maininpackage.json=./out/extension.js. Rebuild, then confirm the new code is actually in the artifact (using the jump-fix symbol as an example):bashpnpm run vscode:prepublish pnpm exec node -e "console.log(require('fs').readFileSync('out/extension.js','utf8').includes('resolveSelfMethodCandidates'))" # must print true; false means the compile is stale or was never run - Rebuild and install (shortest path;
out/and*.vsixare gitignored):bashThen runpnpm install pnpm run package # vsce runs vscode:prepublish = compile + bundle code --install-extension kode-kbengine-*.vsixDeveloper: Reload Windowbefore testing. - Confirm the extension activated: activation events are only
workspaceContains:**/*.defand opening a.deffile — there is noonLanguage:python. In a pure-Python folder with no.defanywhere the extension never activates, so the Python definition provider does not exist. Open any.deffile or switch to a workspace root that contains.def. - No new setting is required: none of the 41
contributes.configurationkeys is a jump/mixin/index switch, and the Python definition provider is registered unconditionally atsrc/extension.ts:205.
Testing
Tests depend on neither a real KBEngine environment nor a VSCode download: vitest (tests/) carries all functional tests — pure logic, the local simulators (tests/sim/), and assembly/panel tests on the fake-vscode stand-in (tests/fake-vscode/); mocha (src/test/suite/) only smoke-tests the compiled artifacts (activation/commands/completion of the packaged out/extension.js). For the layering and how to run, see TESTING.md and the redesign notes.
Test Coverage
Two reports feed the same Codecov project, each uploaded by its own CI job in .github/workflows/ci.yml:
- TypeScript (
src/,tests/): thebuildjob runspnpm exec vitest run --coverageand uploadscoverage/lcov.info. - Rust core (
crates/): therust-coveragejob runscargo llvm-cov --workspace --all-targets --no-fail-fast --lcov --output-path coverage/rust/lcov.infoand uploads that file with therustflag.
That job is also the Rust test gate: it forwards --workspace --all-targets --no-fail-fast to cargo test, so every lib, bin, test, example and bench target runs, all of them run even after a failure, and any failure exits non-zero so the job goes red. Rust tests are executed there and nowhere else, so they run once per CI run.
The README badge and the Codecov overview graph merge both uploads; to look at the Rust report alone, pick the rust flag in the Codecov UI (flags are created by the upload itself, see the Codecov flags docs). To reproduce the Rust numbers locally — the toolchain version comes from rust-toolchain.toml:
rustup component add llvm-tools-preview # once
cargo install cargo-llvm-cov --locked # once
cargo llvm-cov --workspace # terminal report
cargo llvm-cov --workspace --all-targets --no-fail-fast --lcov \
--output-path coverage/rust/lcov.info # the CI commandBranch coverage is not in that report. Rust instruments branches only on nightly (-Zcoverage-options=branch), and this repository pins a stable toolchain, so the published Rust figures are line, region and function coverage.
Working on the Docs
The VitePress docs entry point is docs/.
Local Preview
pnpm run docs:devBuild the Static Site
pnpm run docs:buildPre-Release Checks
Check at least the following:
- Are
README.md,docs/, andCHANGELOG.mdin sync - Are the commands, settings, and version in
package.jsoncorrect - Does the
.deflanguage surface match what the docs describe - Do the dependency graph, entity explorer, logs, and debug entry points open
- Does the packaged VSIX contain the parser worker — after
vsce package, unzip the artifact and confirmextension/out/pythonParserWorker.jsis present, then start it from the unpacked path withnode(new Worker(<unpacked>/extension/out/pythonParserWorker.js)) and check a parse request gets itsid/revision/parsedreply. Structure guards for this live intests/vsixPackaging.test.ts:.vscodeignoremust excludeout/**before keeping!out/pythonParserWorker.js, thebundlescript must keep the worker esbuild entry, and the worker/parser sources must not importvscode(the worker starts from the package path without the extension host). Verified 2026-10-29 on a locally packaged artifact (REL-003). - Does the packaged VSIX expose the build identity — the same unzipped artifact must carry
extension/out/buildCommit.json, and itscommitfield must equal thegit rev-parse HEADthe package was built from (verified 2026-10-29, REL-004). At runtimereadBuildCommitreads<extensionPath>/out/buildCommit.jsononly; a missing or corrupt file reportsunknownand never falls back to the source checkout's git state, so a source-tree commit can never impersonate the installed build. - Run the post-install smoke against the packaged artifact —
pnpm run test:smoke:vsixpackages the VSIX, unzips it into the install layout, loads the unpackedextension/folder as the extension in a real VS Code host, and asserts real hits: identity (extension path is the artifact, install-layout files present), hover on a.deftag, a.def→entity-script definition jump with an exact source line, and a cross-file self-method jump whose implementation lives in a >256 KiB Python file — a file that can only have been parsed by the packaged worker thread (REL-006, verified 2026-10-29; wiring locked bytests/vsixSmokeWiring.test.ts).KODE_VSIX_PATH=<path.vsix>can inject a prebuilt package for fast reruns.
Version Policy
The project is still in the 0.1.x fix-and-refine stage.
When to Stay on 0.1.x
These changes default to patch versions:
- Bug fixes
- Documentation improvements
- Refining existing features
- Adding settings without changing existing default behavior
- Improving hover, diagnostics, highlighting, and navigation
When to Consider 0.2.0
Only with an obvious stage upgrade, for example:
- Introducing a major new module
- Broadly changing default behavior
- Introducing configuration changes that require migration
- Clearly changing the external capability boundary
Recommended Release Cadence
Day-to-Day Fixes
- Version:
0.1.x - Update
CHANGELOG.md - Push to
mainafter committing
Stage Releases
- Summarize doc and feature changes
- Confirm screenshots, descriptions, version
- Run
pnpm run package - Then decide whether to publish to the Marketplace
Current Documentation Maintenance Principles
README.mdis the repo homepage overviewdocs/holds the long-term maintained structured documentationCHANGELOG.mdrecords version changes- Design documents under
resources/docs/are kept as design deposits, no longer the sole usage documentation