feat: restore index cache commands - #65
Conversation
|
| Filename | Overview |
|---|---|
| crates/server/src/scan.rs | Implements persistent per-workspace asset index cache keyed by roots, schema hash, and file fingerprints. |
| crates/server/src/backend.rs | Switches workspace scanning to cached scan results and adds LSP commands/custom request for clearing, rebuilding, and locating the cache. |
| editors/vscode/src/extension.ts | Adds a handler to reveal the cache path, but omits handlers for the contributed clear and rebuild commands. |
| editors/vscode/package.json | Contributes cache-management commands and activation events, but the clear/rebuild commands lack extension-side handlers. |
Comments Outside Diff (1)
-
General comment
Server package test target fails to compile
- Bug
cargo test -p zerosyntax-serverfails before running tests becausecrates/server/tests/cli.rsreferencesenv!("CARGO_BIN_EXE_zerosyntax-lsp"), but that compile-time environment variable is not defined for the current Cargo target.
- Cause
- The integration test uses the compile-time
env!macro for a Cargo-provided binary path that is unavailable in this package test context.
- The integration test uses the compile-time
- Fix
- Update the CLI integration test to resolve the binary path at runtime, for example with
std::env::var("CARGO_BIN_EXE_zerosyntax-lsp"), or adjust the package/bin test configuration so Cargo defines the variable for this target.
- Update the CLI integration test to resolve the binary path at runtime, for example with
- Bug
Reviews (1): Last reviewed commit: "feat: restore index cache commands" | Re-trigger Greptile
| context.subscriptions.push( | ||
| vscode.commands.registerCommand("zerosyntax.openIndexCacheLocation", async () => { | ||
| const cachePath = await client?.sendRequest<string>("zerosyntax/indexCachePath"); | ||
| if (!cachePath) { | ||
| return; | ||
| } | ||
| const cacheUri = vscode.Uri.file(cachePath); | ||
| if (fs.existsSync(cachePath)) { | ||
| await vscode.commands.executeCommand("revealFileInOS", cacheUri); | ||
| } else { | ||
| vscode.window.showInformationMessage(`ZeroSyntax index cache will be created at ${cachePath}.`); | ||
| } | ||
| }), |
There was a problem hiding this comment.
Commands are unhandled
package.json now contributes and activates zerosyntax.clearIndexCache and zerosyntax.rebuildIndexCache, but this activation block only registers zerosyntax.openIndexCacheLocation. Selecting the clear or rebuild commands from the command palette has no VS Code handler and never forwards to the server's workspace/executeCommand, so the cache-management commands are unusable from the extension.
Artifacts
Repro: executable VS Code API harness for command registration
- Contains supporting evidence from the run (text/javascript; charset=utf-8).
Repro: command registration and invocation output
- Keeps the command output available without making the summary code-heavy.
|
Addressed Greptile's command-wiring finding in 1609eab: clear and rebuild now explicitly dispatch workspace/executeCommand to the language server. Verified with npm run compile (editors/vscode) and cargo test -p zerosyntax-server. The reported CLI test issue was not reproducible; that command passed unchanged. |
# Conflicts: # crates/server/src/backend.rs
Restores persistent asset-index caching and adds VS Code commands to clear, rebuild, and reveal the cache location.\n\nValidation:\n- cargo test -p zerosyntax-server\n- npm run compile (editors/vscode)