-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Include LSP Support #68
Comments
Hi, do you have some specific LSPs in mind? I was not aware of this new functionality in IDEA. Looks like it just got introduced by 2023.2, which means it might be a bit tricky to implement without loosing support for older versions of the IDE. (Usually, I would drop support for older versions in about one year.) I am also a bit confused that the Community Edition of IntelliJ is not listed in the blog post. Anyway, if there is a good LSP, it might be an interesting option. |
There are two LSPs I know of that are somewhat Feature complete. Nil (https://github.com/oxalica/nil) and Nixd (https://github.com/nix-community/nixd). I hoped that there could be some "easy" option to make this backwards compatible, like checking if something is available in the classpath. Also I hoped that there would be some easy way to add ultimate features if there it is the IDE. Maybe I'm just plain wrong with my assumptions :) Would love to see this feature and the future :) |
FYI, I tried out the LSP integration of IntelliJ on the Anyway, it would be more effort to integrate this without removing support for the previous versions of IntelliJ. It is also a bummer that this feature only works with paid versions of IDEA. Maybe I try out lsp4intellij later, but I fear I will not have time for that in the next few weeks. |
I tried out lsp4intellij with nil, but it didn't feel very stable on a first glance. I run into two different
I may look a bit closer, but I am currently a bit sceptical. EDIT: FIY, I also pushed the code to the |
hey @JojOatXGME I think providing LSP support for nix-idea would be huge - the current lack of nixd is the only reason I use VSCode instead of intelliJ for Nix (try it yourself to see the difference!). In every other aspect IntelliJ is better. I know nothing about LSPs but I have developed an IDEA plugin before and I am happy to help.
What do you think? |
@cottand The main reason why I haven't spent more time on implementing LSP-support using the LSP integration is that it would only work in paid versions of IDEA. I only have the community editions, so I wouldn't be able to use it. I fear JetBrains might be reluctant to put this feature into the community editions, as it would make the premium features less worthwhile. If you would like to spend time on this, I would be open to merge the pull request. BTW, After my disappointing experiment with lsp4intellij, I also thought about implementing my own LSP integration for a short moment, but then I realized that I don't have time for such a project. 😄
Not sure, I haven't spent much time on debugging the issue.
I am not sure if this would still be a problem as IntelliJ 2024.1 might be released in a few months. Anyway, I don't think that this should block us. We could probably drop support for 2023.1 earlier than usual. (The old version of the plugin would still work for previous versions of IDEA.)
Packaging the plugin via Nix is something I would also like to see. However, I think this would be another independent topic. I only spend a limited time thinking about this topic so far. I imagine it might be tricky. Note that the plugin currently uses the official Gradle plugin from JetBrains. This plugin downloads all the dependencies on demand. I am not sure how easy it is to make all of that work in an offline build environment as used by Nix. There are probably some dependencies currently still missing in |
Also completely fair :D
Thanks, I will think about it. I had not realised that the community edition does not support LSPs (yet?). FYI as an open source contributor you could request an Ultimate licence.
👍 makes sense As for packaging via Nix, I can make a PR if it is something you want and there are benefits for. I think I can manage Gradle if the dependencies are locked, which is usually the case for JARs. |
I hope it is yet. However, I can imagine that they fear that it would diminish the value proposition of the ultimate edition. People could easily start using an LSP for JavaScript and other languages, for which you have to pay right now. I haven't found any specific information about that when I looked into it.
I personally don't need it right now. So I wouldn't prioritize it that high as long as nobody complains. It just seems strange that this project kind of ignores the packaging process of Nix. Also note that the Gradle plugin |
done :) sounds good, I will consider spending time on this, and we can revisit if JetBrains makes lsp available for the community edition |
hey, i think even releasing a basic version like the one you linked above would be a huge boon (built it myself to try out, and the basic functionality it offers is already satisfactory for most of my needs). I really don't wanna have to switch to vscode just for nix files... |
@abovestratosphere Do you know if you have tried the version with lsp4intellij, or the version using the LSP integration of IDEA? I was not convinced by lsp4intellij as it did throw a lot of exception during my tests. I am probably not able to fix them. However, if you think it is still valuable, I guess I could think about integrating it behind some feature flag. Regarding the solution using JetBrains LSP integration (paid versions only): I have recently seen some analytics from JetBrains, and was surprised how many users of the plugin seem to use IntelliJ Ultimate. So, maybe integrating this solution makes more sense as I though initially. I am still only using the community edition, through. 🤷♂️ (Do you have a paid version of IDEA?) |
looks like the version i built was e815bfe, all I did was bump the supported IDE version on that commit so it could work for me, so not the lsp4intellij commit. I'm honestly not clear on the difference between using lsp4intellij vs whatever you did in the first commit (not familiar with jetbrains plugin ecosystem at all). I personally don't use intellij since I dont work in java but my company sponsors all jetbrains licenses, so yes I have all paid jetbrains IDEs. FWIW, most folks I know use vscode or neovim for nix (because of lsp support), but I definitely know other diehard jetbrains users who are dying for nix lsp support in this plugin, there's dozens of us :) |
@abovestratosphere did you use |
I used whatever that commit e815bfe used, which is nil |
I haven't tried it but there's https://github.com/redhat-developer/lsp4ij |
I just implemented and released some experimental solution using JetBrains' LSP API. See version 0.4.0.13 and commit cfe2ef1. There are currently no automatic tests, and I only tested the basics manually. I hope everything works. As it is using JetBrains' API, it only works for paid versions of IDEA. If someone wants to try out https://github.com/redhat-developer/lsp4ij (thanks @amacfie) to make it available for free, I am happy to help. I may also take a look at it at some point, but probably not in the near future. PS: During my short tests, I no-longer noticed the exception I have observed with nixd in the past. However, nil still provided a better experience during my tests, as it was more responsive. In contrast to nil, nixd also wasn't able to resolve the paths in the files I used. |
@JojOatXGME thanks a lot. just tested, it works great for me. |
LSP4IJ has been released. If you want to try to integrate your language server without developping an IJ plugin please read https://github.com/redhat-developer/lsp4ij/blob/main/docs%2FUserDefinedLanguageServer.md If you want to try to integrate your language server by developping an IJ plugin please read https://github.com/redhat-developer/lsp4ij/blob/main/docs%2FDeveloperGuide.md If you want to know the LSP support please read https://github.com/redhat-developer/lsp4ij/blob/main/docs%2FLSPSupport.md |
There are a few language servers out there for nix. It would be great if you could use those from within JetBrains Products. An example library to do this 'quick' and 'dirty' would be https://github.com/ballerina-platform/lsp4intellij. Other than that, JetBrains Products started allowing plugin developers to communicate with LSPs from the Plugin, starting from 2023.2 (see: Language Server Protocol for Plugin Developers)
Would love to be able to use LSPs in combination with IntelliJ, and thank you in advance for your time :)
The text was updated successfully, but these errors were encountered: