Skip to content

Commit b031cd0

Browse files
montymxbclaude
andauthored
v0.2.0: broader LSP coverage, server aware saves, server to client handling
New BenchContext methods: - navigation: declaration, documentHighlight, prepareRename - formatting: rangeFormatting, onTypeFormatting - structure: foldingRange, selectionRange, documentLink, codeLens, inlayHint - semantic tokens (full, range, delta), workspaceSymbol - call and type hierarchy - pull diagnostics: documentDiagnostic, workspaceDiagnostic - resolve variants for completi, inlay hint, document link and workspace symbol - document lifecycle: saveDocumtUntil Save handling follows the server's static and dynamic save sync options, exposed via LspHarness.saveSynco client requests (refreshes, progress create, sht, unregisterCapability) are now answered instead of rejected with MethodNotFound. Client capabilil new requests. Behavior changes: - saveDocument may send nothingt - resolveSupport is advertised,k to resolve Fixes: - stop() now sends SIGKILL afte SIGTERM - edit applies changes to the tracked document text - codeAction diagnostic code ficode - addRegisteredLanguage mappingnow lowercased Docs and tests: README and `lsbAPI, stale CLI and config docs are corrected, ns against Langium's grammar language server, and the examples show the new methods. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 parents c2f8c27 + df2e8a0 commit b031cd0

18 files changed

Lines changed: 2705 additions & 141 deletions

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ jobs:
5656
- name: Install dependencies
5757
run: npm ci
5858

59-
# clones, installs, and builds the minilogo language server, then drives it
60-
# over stdio via the built lsbench harness
61-
- name: Integration test (minilogo language server)
59+
# clones, installs, and builds the minilogo language server, starts the Langium
60+
# grammar language server from devDependencies, and drives both over stdio
61+
# via the built lsbench harness
62+
- name: Integration test (minilogo + Langium grammar language servers)
6263
run: npm run test:integration

‎CHANGELOG.md‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# CHANGELOG
22

3+
## v0.2.0
4+
5+
Adds most remaining LSP requests to `BenchContext`, server-aware save handling, answers for common server to client requests, and a second integration suite against Langium's grammar language server.
6+
7+
### New BenchContext methods
8+
9+
- **Navigation:** `declaration`, `documentHighlight`, `prepareRename`
10+
- **Formatting:** `rangeFormatting`, `onTypeFormatting`
11+
- **Document structure:** `foldingRange`, `selectionRange`, `documentLink`, `codeLens`, `inlayHint`
12+
- **Semantic tokens:** `semanticTokensFull`, `semanticTokensRange`, `semanticTokensDelta`
13+
- **Workspace symbols:** `workspaceSymbol`
14+
- **Call/type hierarchy:** `prepareCallHierarchy`, `callHierarchyIncomingCalls`, `callHierarchyOutgoingCalls`, `prepareTypeHierarchy`, `typeHierarchySupertypes`, `typeHierarchySubtypes`
15+
- **Pull diagnostics:** `documentDiagnostic`, `workspaceDiagnostic`. The `textDocument.diagnostic` client capability is intentionally not advertised, since some servers switch from push to pull diagnostics when it is present, which would break `waitForDiagnostics`.
16+
- **Resolve:** `completionItemResolve`, `codeActionResolve`, `codeLensResolve`, `inlayHintResolve`, `documentLinkResolve`, `workspaceSymbolResolve`
17+
- **Document lifecycle:** `saveDocument`, `willSave`, `willSaveWaitUntil` (timed)
18+
19+
### Save handling
20+
21+
- Save related sync options are read from the static `textDocumentSync` capability and from dynamic registrations of `textDocument/didSave`, `textDocument/willSave` and `textDocument/willSaveWaitUntil`. A bare `TextDocumentSyncKind` number implies `didSave` without text, matching `vscode-languageclient`. They are available via `LspHarness.saveSyncOptions()`, and `SaveSyncOptions` is exported.
22+
- `saveDocument` only sends `didSave` when the server wants it, and includes the current document text when it asks for `includeText`. `willSave` is also only sent when wanted, while `willSaveWaitUntil` is always sent since it is timed.
23+
24+
### Server to client requests
25+
26+
- Refresh requests (`workspace/semanticTokens/refresh`, `inlayHint/refresh`, `codeLens/refresh`, `inlineValue/refresh`, `diagnostic/refresh`) and `window/workDoneProgress/create` are acknowledged.
27+
- `window/showMessageRequest` is dismissed with `null`, and `workspace/applyEdit` is declined with `applied: false`.
28+
- `client/unregisterCapability` is now handled.
29+
30+
Previously these were rejected with a JSON-RPC `MethodNotFound` error, which some servers log noisily or handle poorly.
31+
32+
### Client capabilities
33+
34+
- Advertises capabilities for every new request, including `codeAction` `dataSupport` and `resolveSupport`, `inlayHint` and workspace symbol `resolveSupport`, semantic token requests (full, delta, range), and `linkSupport` for declaration.
35+
36+
### Behavior changes
37+
38+
- `saveDocument` now respects the server's save options, so it may send nothing, or send `didSave` with the full text, where it always sent a bare `didSave` before.
39+
- `codeAction` and `inlayHint` `resolveSupport` and workspace symbol `resolveSupport` are now advertised, so some servers may return partial items and defer work to the matching resolve request. Benchmarks of those requests may get faster, with the cost moving to resolve.
40+
41+
### Fixes
42+
43+
- `stop()` never force killed a server that ignored `SIGTERM`, since it checked `process.killed` (which only reports that a signal was sent). It now checks for an actual exit and sends `SIGKILL` after 3 seconds.
44+
- `edit` now applies each edit to the locally tracked document text, in order, following LSP incremental `didChange` semantics. Previously the tracked text never changed after `openDocument`.
45+
- `codeAction` diagnostic code filtering now also matches `data.code`, so quick fixes from servers like Langium that store their issue code in `data` can be triggered.
46+
- `addRegisteredLanguage` stored the extension mapping backwards (language id to extension instead of extension to language id). Extensions are now also lowercased to match `detectLanguageId`.
47+
- `BenchContext.workspaceRoot` is documented as the absolute workspace path it actually holds, not a URI.
48+
49+
### Docs and tests
50+
51+
- README and `lsbench prime` list the full API grouped by area, describe save sync and server to client handling, and correct the stale CLI options and server configuration sections (a JSON server config file was documented but never supported, use `--init-options-file` instead).
52+
- New integration suite against Langium's grammar language server (from devDependencies), covering formatting, code actions, semantic tokens, call and type hierarchy, and more. The minilogo suite now covers the additional methods it supports, and both suites list unsupported methods as skipped.
53+
- `examples/typescript-actions.ts` showcases the new methods.
54+
355
## v0.1.0
456

557
First release!

0 commit comments

Comments
 (0)