-
Notifications
You must be signed in to change notification settings - Fork 401
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
Provide jdt.ls Bootstrapping Documentation #2043
Provide jdt.ls Bootstrapping Documentation #2043
Conversation
Can one of the admins verify this patch? |
CONTRIBUTING.md
Outdated
|
||
1) Please, download [Eclipse PDE support][1], open the `.vsix` file with a ZIP programm and extract the folder `/extension/server/` into a local directory. | ||
|
||
2) Ensure that [the initialize request][2] contains all paths to the extracted files in the `bundles` parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a good way to ensure that's the case? Is there additional documentation about that, for the case of nvim-jdtls, somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/emacs-lsp/lsp-java for emacs has a parameter "lsp-java-bundles - List of bundles that will be loaded in the JDT server." which is probably what is needed for emacs to work here! I haven't had time to try it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add links to the Neovim and Emacs configs as a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now tried it in emacs, and it works! Some things are a little bit slow, but that's perhaps because the java project I'm working on is large. I should probably look at some of the options for ls-mode.
This is great! Thanks so much @schrieveslaach , this has really made my week!
A template configuration for emacs would be something like:
"
2 b) For setting up PDE support with lsp-mode (https://github.com/emacs-lsp/lsp-java) in emacs, a configuration like the following can be used e.g. in your init.el:
(use-package lsp-java
:config (setq lsp-java-bundles (directory-files "/path/to/extracted/folder/" t ".jar"))
:hook (java-mode . lsp))
This will configure lsp-java to be activated when a java file is opened, and will send the required bundle files to JDTLS.
"
ffec859
to
c2a67b5
Compare
CONTRIBUTING.md
Outdated
@@ -49,10 +49,24 @@ this will get rid of the errors. | |||
|
|||
The errors should now be gone. | |||
|
|||
### C) Setting up the JDT Language Server in JDT Language Server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Setting up the JDT Language Server in other clients
?
If you feel "other" is a bit dismissive we could maybe use something like "lightweight editors", or "vim/emacs clients" for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps "Setting up the JDT Language server in nvim or emacs"
or perhaps two sections, one for each?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question, @rgrunber and @schrieveslaach , JDTLS is configured automatically in lsp-mode, but it just works for gradle or maven projects. It doesn't understand PDE projects, by default. Is that the case also in nvim, @schrieveslaach ? If so, should this section clarify that these instructions just are needed for getting PDE support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, "Setting up the JDT Language server in nvim or emacs" is fine with me.
It just works for regular Maven/Gradle projects, but JDT-LS uses a Maven plugin called Tycho (meant to replace PDE for headless builds on infra) which I don't believe is properly supported in m2e. As a result, simply importing the project won't just work. There would still be build errors. You may get some of the Java features, but it wouldn't be the best possible experience. That's why we have these instructions to set up PDE build support. I wouldn't clarify, because at least for now, I think this is the only way to support things properly.
Provide information how to contribute to eclipse.jdt.ls while using eclipse.jdt.ls (not VS-Code and not Eclispe). Fixes eclipse-jdtls#1953
c2a67b5
to
2f07565
Compare
Provide information how to contribute to eclipse.jdt.ls while using eclipse.jdt.ls (not VS-Code and not Eclispe).
Fixes #1953