rust-lang / rust-lang/rust-analyzer
minimal_lsp.rs example doubly-nests the InitializeResult capabilities property
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer version: 0.3.2743-standalone (6a1246b69c 2026-01-04) [c:\Users\Grego.vscode\extensions\rust-lang.rust-analyzer-0.3.2743-win32-x64\server\rust-analyzer.exe]
rustc version: rustc 1.92.0 (ded5c06cf 2025-12-08)
editor or extension: VSCode 1.107.1 994fd12f8d3a5aa16f17d42c041e5809167e845a x64 rust-lang.rust-analyzer 0.3.2743
relevant settings: N/A
The minimal_lsp.rs lsp-server example does not return a valid InitializeResult; it doubly-nests the capabilities property by specifying it in two places:
let init_value = serde_json::json!({
"capabilities": caps,
"offsetEncoding": ["utf-8"],
});
let init_params = connection.initialize(init_value)?;
connection.initialize definition in lib.rs line 287:
let initialize_data = serde_json::json!({
"capabilities": server_capabilities,
});
self.initialize_finish(id, initialize_data)?;
For background, I'm using this library to learn about and implement my own language server and this error was tough to debug as a novice. Updating the example may help other interested folks like myself build the skills to help contribute back to this amazing open-source project.
Thank you for all your work on this awesome VSCode extension and supporting libraries!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/lsp-server/examples/minimal_lsp.rs around line 132 and compare its initialization data with connection.initialize in lib/lsp-server/src/lib.rs around line 287. Check the LSP InitializeResult specification and run the example's relevant build or tests. Done means the example produces a correctly shaped InitializeResult without doubly nesting capabilities.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100