Replies: 1 comment
-
|
Thank you for the RFC. This is a very interesting idea. My immediate thought was wondering if any other language servers have attempted to do something similar or if someone already tried to formalize something like this as part of the LSP spec. Did you search https://github.com/microsoft/language-server-protocol and https://github.com/microsoft/vscode-languageserver-node for any prior art in this area? I especially like this idea because it removes one major limitations of add-ons: they are fully constrained to what the spec allows. By allowing companion VS Code extensions, add-ons can ship custom functionality for both the server and the extension, which I'm really excited about. There are some concerns of course, that we would need to consider:
All of that said, we're about to start the adoption of our new code indexer in the LSP, which will result in many major breaking changes for add-ons. It would probably be better to explore this after that migration is complete. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
ruby-lspaddons can register custom request handlers usingcreate_custom_request_handler. Addon developers who want to expose these features to users via companion VS Code extensions currently have no supported way to do so.The VS Code extension keeps the
LanguageClientinternal, meaning companion extensions cannot send custom requests through it.Use Case
I'm developing an addon that provides:
semanticSearch: Find code by meaning using vector embeddingsimpactAnalysis: "What calls this method?" dependency graphsThe addon exposes these via custom LSP methods:
To let users invoke semantic search from VS Code (e.g.,
Cmd+Shift+F→ input box → results), I need to send requests to the LSP server. Without access to the language client, my workaround is spawning Ruby subprocesses to query the database directly—bypassing LSP entirely.This works but is inefficient (cold starts, memory overhead) and doesn't benefit from the already-running LSP server.
Proposal
Export a minimal API from the VS Code extension:
Usage from a companion extension:
Benefits
Implementation
In
vscode/src/client.ts:Questions for Maintainers
addon/)?Happy to submit a PR if there's interest!
Beta Was this translation helpful? Give feedback.
All reactions