-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add native lsp support #3406
Comments
Thank you for the detailed explanation. As you have seen, the LSP has been strongly tailored to work with the VS Code extension. I'm open to making changes so it is easier to integration with nvim and sublime. A compatibility mode as you suggest with Background Information
One of the biggest requests / complaints was to show spelling issues independent from the normal coding issues. It was requested to hide them from the problems pane and to use custom decorations. To accomplish this, it was necessary to send Diagnostics as a custom notification instead of using the LSP Diagnostics Reporting. The format of the Diagnostics have not changed, so it should still be possible, it just needs to be a setting telling it to use vscode-spell-checker/packages/_server/src/server.mts Lines 482 to 506 in 0703126
It sends a command instead of edits. The command gets turned into edits on the client side. I was necessary to do it this way to use the VSCode rename feature. It is not too difficult to send edits instead. Related code: vscode-spell-checker/packages/_server/src/codeActions.mts Lines 163 to 173 in 0703126
The Related code: vscode-spell-checker/packages/_server/src/codeActions.mts Lines 182 to 184 in 0703126
This configuration information is connected to adding words to dictionaries (the targets) in the client. If it is not necessary to support adding words to dictionaries, then It should be possible to ignore this.
I can see how that might be an issue. Related code: vscode-spell-checker/packages/_server/src/codeActions.mts Lines 96 to 111 in 0703126
|
One of the challenges here is that I don't have any insight into who is trying to use this as a LSP service, making it very easy to break things. In the latest version, the server sends RPC requests to the client to load file if they use a virtual protocol. See: _server/src/vfs/CSpellFileSystemProvider.mts |
@Jason3S thank you for all your comments! That will really help me. I hope I will start soon on working this 🙂 |
We would also be interested by a native LSP support to use it in the Zed editor, there is a dedicated issue on their end for this purpose: zed-industries/extensions#1414 |
Update: I've developed a working solution for Neovim LSP integration. You can find the implementation here: The workaround functions as intended, so I decided to stop working on native mode. By the way, the codebase is well-structured, making it straightforward to implement this native mode if anyone wants to take it on 🙂 |
@quolpr, |
@Jason3S oops, here is updated URL https://gist.github.com/quolpr/2d9560c0ad5e77796a068061c8ea439c |
Hello! I've been working on adding LSP support to nvim and encountered a few issues:
_onDiagnostics
instead of the expectedtextDocument/publishDiagnostics
.codeAction
. Below is an example of the edit JSON:_onWorkspaceConfigForDocumentRequest
command to make cspell work correctly.codeAction
. I had to patch the server with the following code to make it work:These issues make integrating cspell into nvim and other editors challenging. I'm considering adding a new setting, like
cSpell.isNativeMode
, which would make cspell function like a standard LSP. This could be a significant improvement for other editors!Here is a workaround for nvim - nvim workaround
And here is one for sublime - sublime workaround
The text was updated successfully, but these errors were encountered: