Skip to content
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

IntelliJ example #999

Closed
ctron opened this issue Mar 27, 2023 · 12 comments
Closed

IntelliJ example #999

ctron opened this issue Mar 27, 2023 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@ctron
Copy link

ctron commented Mar 27, 2023

On the homepage it is mentioned that Langium can be used for IntelliJ editors. However, I wasn't able to find any information on how this could be achieved.

I think it makes sense to provide an example project, or at least outline the steps necessary.

@msujew
Copy link
Member

msujew commented Mar 27, 2023

Hi @ctron,

Langium can be used by every editor that somehow supports the language server protocol (LSP). There's an LSP plugin available for IntelliJ that would allow to connect to a Langium based language server.

Note that for IntelliJ in particular, the LSP is effectively a second-class citizen, since their "normal" languages are so tightly integrated into the IDE, which is just not feasible with the LSP alone. This is why we don't offer explicit support for IntelliJ as of now. In theory you could provide a more deeply integrated, specialized plugin for a Langium based language, but I'm not sure how one would go on about this. My knowledge about IntelliJ plugin development is fairly limited.

Also note that JetBrains have their own DSL workbench specificially crafted towards their products called MPS. Maybe that fits better with your requirements.

@cdietrich
Copy link
Contributor

see also ballerina-platform/lsp4intellij#303

@ben5311
Copy link

ben5311 commented Apr 5, 2023

On the homepage it is mentioned that Langium can be used for IntelliJ editors. However, I wasn't able to find any information on how this could be achieved.

I think it makes sense to provide an example project, or at least outline the steps necessary.

I have tried both the IntelliJ Marketplace Plugin https://plugins.jetbrains.com/plugin/10209-lsp-support and the IntelliJ Plugin dependency https://github.com/ballerina-platform/lsp4intellij.

The Marketplace Plugin is actually working: Validations, Quick Fixes, Formatting, etc.
But it crashes randomly and is not actively developed anymore.

With the lsp4intellij solution you need to setup you own IntelliJ extension project and integrate the Langium LSP server into it. It did not work for me, even though the project seems to be still alive.
It does connect to the Langium LSP Server and I can even see that it receives notfications from it (e.g. on Hover) but it does not display it in the IntelliJ UI.

For me the IntelliJ LSP integration looks not really stable at the moment.
Also note that Syntax Highlighting usually does not work via LSP. Meaning you need to add Syntax Highlighting manually for IntelliJ / Eclipse / Other LSP editor.

@nadavhames
Copy link

Instead of IDEA, Jetbrains is coming out with Fleet soon which uses LSP, so support should be much easier for that product once it supports editor plugins.

@pluralia pluralia added the good first issue Good for newcomers label Nov 1, 2023
@msujew msujew added help wanted Extra attention is needed and removed good first issue Good for newcomers labels Nov 1, 2023
@angelozerr
Copy link

Please try https://github.com/redhat-developer/lsp4ij which is a free lsp support for intellij

@Yokozuna59
Copy link
Contributor

Fellows at zenstack were able to create the JetBrains extension:

@spoenemann
Copy link
Contributor

In the meantime, JetBrains has started offering LSP support for their paid IDEs: https://blog.jetbrains.com/platform/2023/07/lsp-for-plugin-developers/

As I understand this, the solution is not available for the open source IntelliJ Platform.

@spoenemann
Copy link
Contributor

@angelozerr
Copy link

angelozerr commented May 28, 2024

@spoenemann as I said please try https://github.com/redhat-developer/lsp4ij  which is a free lsp support for intellij which 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

@angelozerr
Copy link

@spoenemann just for your information, we did the 0.0.2 release of LSP4IJ and if you want to have an overview of LSP4IJ, please read Meet LSP4IJ, a new LSP Client for JetBrains-based IDEs article that we have published on friday.

Hope you will like it.

@spoenemann
Copy link
Contributor

Nice!

@msujew
Copy link
Member

msujew commented Jun 24, 2024

I've opened eclipse-langium/langium-website#243 to track documentation on this. I think we should continue the discussion there. I'm closing this issue.

Thanks for the info about LSP4IJ, we'll surely include this on the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants