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

Move LSP4IJ in a proper Language Server Intellij plugin? #1260

Closed
angelozerr opened this issue Nov 8, 2023 · 17 comments
Closed

Move LSP4IJ in a proper Language Server Intellij plugin? #1260

angelozerr opened this issue Nov 8, 2023 · 17 comments
Assignees
Labels
build enhancement New feature or request lsp4ij LSP client for IJ
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Nov 8, 2023

Ij Quarkus starts providing a robust, performant LSP support for IJ in https://github.com/redhat-developer/intellij-quarkus/tree/main/src/main/java/com/redhat/devtools/intellij/lsp4ij

This support provides too an advanced LSP consoles which is very helpful for developer and user. See https://quarkus.io/blog/intellij-quarkus-recap/#language-server-client-improvements

We wonder if IJ community could be interested to move this LSP support in a proper Language Server Intellij plugin.

If you are interested with this plugin please vote. Thanks!

@gayanper
Copy link

gayanper commented Nov 9, 2023

This would be great for integrating other LSP based tools such as Spring Tools for example

@angelozerr
Copy link
Contributor Author

This would be great for integrating other LSP based tools such as Spring Tools for example

Thanks @gayanper for your feedback!

@BoykoAlex @martinlippert do you think you could be interested with this LSP support for IJ? LSP4IJ have the same architecture than LSP4E. We need just add some missing operation like folding, format etc.

@angelozerr angelozerr added enhancement New feature or request lsp4ij LSP client for IJ labels Nov 9, 2023
@martinlippert
Copy link

Thanks @angelozerr for pointing us at this, much appreciated. Even though we don't ship an integration of the Spring Tools language server for IntelliJ ourselves, having a solid LSP integration for IntelliJ sounds like a great thing to have and would definitely make it easier for the community to integrate things like the Spring Tools language server (among others) into IJ.

@paulcwarren
Copy link

@angelozerr given the absence of Jetbrains official support from the community edition I think this is a stirling idea. It would be better for the community to raly around and help maintain a single LSP integration than have us all managing our own.

@fbricon
Copy link
Contributor

fbricon commented Nov 17, 2023

We're planning to extract lsp4ij into a separate extension/repo in the coming weeks. Stay tuned.

@angelozerr
Copy link
Contributor Author

@martinlippert @paulcwarren @gayanper thanks so much for your welcome answer. I am glad the idea please you and I hope you will not be disapointed with lsp4ij.

We have worked hard to provide the best support for quarkus with lsp but we dont support all LSP opérations. It means that there are again à lot of work.

More we have none tests. Moving the lsp support to a repository will be a good occasion to write them and I hope we will have a lot of contributions.

@angelozerr
Copy link
Contributor Author

@fbricon could you please take care of creating lsp4ij repository. Thanks!

@yeekangc
Copy link

+1 for a common LSP4IJ layer that the community can rally around, collaborate on, reuse, and work together to evolve.

As @angelozerr @fbricon know, we have built a version of this at https://github.com/MicroShed/lsp4ij and demonstrated that it works. (Feel free to take a look.) Also initiated discussions on a common project that will benefit the community where everyone can participate and contribute.

Glad to contribute what we have done as an initial contribution to a new common project for the community. And, work with everyone to enhance and improve it.

Cc @mrglavas @turkeylurkey @TrevCraw @scottkurz

@yeekangc
Copy link

yeekangc commented Nov 21, 2023

@fbricon, what's your outlook for a new lsp4ij repository? Open to work with you all to move it forward. Don't hesitate to share your plan. Let us know. Thanks.

@yeekangc
Copy link

yeekangc commented Nov 21, 2023

@angelozerr, not sure if you have a particular picture in mind when you mentioned this as a "plugin"? We looked into this and discussed with JetBrains. Landed on an approach that builds a common library that IntelliJ plugins can then include and reuse. This is what's there in https://github.com/MicroShed/lsp4ij at the moment. Glad to share what we have learnt and to discuss further.

@angelozerr
Copy link
Contributor Author

@angelozerr, not sure if you have a particular picture in mind when you mentioned this as a "plugin"?

I mean an Intellij Plugin that we need to plublish to Intellij marketplace and not a library JAR that you need to import in your project (I think it is your idea with https://github.com/MicroShed/lsp4ij).

Perhaps I'm wrong, but I think we need to provide an Intellij Plugin because we contribute to the Intellij UI with:

  • a "generic" Language Server settings

image

  • LSP consoles

image

@angelozerr
Copy link
Contributor Author

@fbricon, what's your outlook for a new lsp4ij repository?

I think we will create the project at https://github.com/redhat-developer/lsp4ij

Glad to share what we have learnt and to discuss further.

Nice! We will be happy to have any contributions! Just keep in mind that your lsp4ij will be not compatible with our lsp4ij because you add this method https://github.com/MicroShed/lsp4ij/blob/fbb525da2c39a060030df79a4354aae29f75b4d4/src/main/java/org/microshed/lsp4ij/DocumentContentSynchronizer.java#L123 which breaks the LSP concept.

@yeekangc
Copy link

Thank you, @angelozerr. We will take a look at these.

lsp4ij is underlying plumbing and not what end-user developers will directly consume. What developers will use would be the various language servers that (will) build/run on top of it. Let's work out the best way to make it available for the community of plugin developers and end-user developers.

@angelozerr
Copy link
Contributor Author

angelozerr commented Nov 21, 2023

lsp4ij is underlying plumbing and not what end-user developers will directly consume.

I'm sorry @yeekangc but I disagree with that. See my comments at

In otherwise when LSP support is working correctly it is nice but when there are some bugs (on language server or client side) it is a real nightmare if we have not:

  • an LSP consoles to track LSP requests/responses
  • the capability to debug a language server with breakpoint

We provide those features out of the box with LSP consoles UI and Language Servers settings to debug it. It is the reason why it is important to contribute to UI IJ with language servers support.

@yeekangc
Copy link

I suppose there is still a distinction between what end-user developers building applications will use versus what is more for plugin developers and debugging purposes. Certainly understand the usefulness and value of the capabilities that you mentioned for handling and debugging error scenarios.

Will need to see where JetBrains stands in terms of the route to make a LSP4IJ available too?

@angelozerr
Copy link
Contributor Author

angelozerr commented Nov 22, 2023

I suppose there is still a distinction between what end-user developers building applications will use versus what is more for plugin developers and debugging purposes.

My skils with vscode and lemminx is that we ask to the end user (who create issues) to enable LSP console and share it in the issue the LSP traces and after that we can understand more the problem and fix issues. For end-user the LSP consoles is used to fix their issues.

Will need to see where JetBrains stands in terms of the route to make a LSP4IJ available too?

I'm sorry I have not understood what you mean?

@angelozerr angelozerr self-assigned this Nov 29, 2023
@angelozerr
Copy link
Contributor Author

angelozerr commented Dec 20, 2023

I close this issue since we have created https://github.com/redhat-developer/lsp4ij and main branch of intellij-quarkus is now based on LSP4IJ.

You can start with:

  • Developer guide which explains step by step how to integrate a language server in LSP4J in an external IntelliJ plugin.
  • User guide which explains how to use LSP console and Language server preferences.
  • LSP support which explains the LSP support.

@angelozerr angelozerr added this to the 1.31.0 milestone Dec 20, 2023
@fbricon fbricon added the build label Dec 20, 2023
@fbricon fbricon modified the milestones: 1.31.0, 1.31.1 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build enhancement New feature or request lsp4ij LSP client for IJ
Projects
Archived in project
Development

No branches or pull requests

6 participants