You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nil crashes on textDocument/didSave notification #1202
how do you use nil with lsp4ij ? With user defined ls or with an IJ plugin?
I have it user defined.
If it is the first, do you want to contribute to LSP4IJ with nil as user defined ls?
All that's needed is assigning nil to *.nix, default config works fine. So I'm not sure that there's much value in that? And I imagine most Nix users wouldn't want an auto installer.
how do you use nil with lsp4ij ? With user defined ls or with an IJ plugin?
I have it user defined.
If it is the first, do you want to contribute to LSP4IJ with nil as user defined ls?
All that's needed is assigning nil to *.nix, default config works fine. So I'm not sure that there's much value in that? And I imagine most Nix users wouldn't want an auto installer.
I think it could be very nice to have that for nix
There is no official nix lsp. There are currently 2 options, nil and nixd. With the main difference being that nixd uses official nix libraries directly to provide proper auto completion, but at least in my experience, nil is still better in terms of code editing. Would the editor notification support promoting two LSPs?
I think it could be very nice to have that for nix
There is no official nix lsp. There are currently 2 options, nil and nixd. With the main difference being that nixd uses official nix libraries directly to provide proper auto completion, but at least in my experience, nil is still better in terms of code editing. Would the editor notification support promoting two LSPs?
Activity
rcjsuen commentedon Aug 4, 2025
Also see #1076.
angelozerr commentedon Aug 9, 2025
@js6pak could you try to install https://github.com/redhat-developer/lsp4ij#testing-nightly-builds and tell me if it fixes your issue.
Thanks!
rcjsuen commentedon Aug 9, 2025
I still get these log messages on 0.15.0-20250809-013311.
rcjsuen commentedon Aug 9, 2025
This code is calling
newSyncOptions.setSave(true)which seems to ignore/override what the server is doing.lsp4ij/src/main/java/com/redhat/devtools/lsp4ij/LanguageServerWrapper.java
Lines 856 to 876 in 1b8d4b8
angelozerr commentedon Aug 9, 2025
Good catch! I think I have implemented that without testing since I had not a language server usecase.
angelozerr commentedon Aug 9, 2025
@js6pak could you please share your lsp traces by activating trace as verbose in lsp console
angelozerr commentedon Aug 9, 2025
I will fix your issue asap. Just one question: how do you use nil with lsp4ij ? With user defined ls or with an IJ plugin?
If it is the first, do you want to contribute to LSP4IJ with nil as user defined ls?
js6pak commentedon Aug 9, 2025
I should have specified, but that's the first thing I tried, yeah.
lsp-trace.txt
I have it user defined.
All that's needed is assigning
nilto*.nix, default config works fine. So I'm not sure that there's much value in that? And I imagine most Nix users wouldn't want an auto installer.angelozerr commentedon Aug 9, 2025
@js6pak your LSP trace seems specify that nil can support save ?
I don't understand.
rcjsuen commentedon Aug 10, 2025
The code doesn't seem to match.
angelozerr commentedon Aug 10, 2025
You are right, perhaps the force from LSP4IJ to true when save is null is the cause of this issue.
Let me try to fix it @js6pak
fix: nil crashes on textDocument/didSave notification
angelozerr commentedon Aug 10, 2025
@js6pak once will be finished https://github.com/redhat-developer/lsp4ij/actions/runs/16858552411 please try again nighty and tell me if it fixes your issue
rcjsuen commentedon Aug 10, 2025
I don't see the error messages in my logs with 0.15.0-20250810-070516. 👍
angelozerr commentedon Aug 10, 2025
Take a sample with astro https://github.com/redhat-developer/lsp4ij/blob/main/docs/user-defined-ls/astro-ls.md#step-1-install-the-language-server
As you can see you need just to create the file and you will have editor notifictation which promote intall of the language server.
I think it could be very nice to have that for nix. If you contribute with templates like https://github.com/redhat-developer/lsp4ij/tree/main/src/main/resources/templates/lsp/astro-ls you will benefit with this feature.
If you want to do that, please read https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserDefinedLanguageServerTemplate.md#how-to-contribute-a-user-defined-language-server-template
js6pak commentedon Aug 10, 2025
It works fine now! Thanks!
There is no official nix lsp. There are currently 2 options, nil and nixd. With the main difference being that nixd uses official nix libraries directly to provide proper auto completion, but at least in my experience, nil is still better in terms of code editing. Would the editor notification support promoting two LSPs?
Also do note that there is an official(I think?) nix intellij plugin (https://github.com/NixOS/nix-idea), but compared to either nil or nixd, it's pretty useless... It also provides LSP support via the IJ Ultimate LSP api (as you know, considering you commented under NixOS/nix-idea#68), but honestly, this project works so much better <3
angelozerr commentedon Aug 11, 2025
You are welcome!
Thanks for your explanation. I think we can start with an user defined ls with nil. If you could be intersted to contribute with nil, I suggest that you use as sample
https://github.com/redhat-developer/lsp4ij/tree/main/src/main/resources/templates/lsp/gopls and use https://github.com/redhat-developer/lsp4ij/blob/main/src/main/resources/templates/lsp/gopls/installer.json to describe the install of nil (ex: check if nix is installed)
Do you think you could be interested to do that?
fix: nil crashes on textDocument/didSave notification