-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Update java support to latest jdt.ls #1583
Conversation
@@ -8,44 +8,44 @@ | |||
import { injectable, inject } from "inversify"; | |||
import { CommandService } from "@theia/core/lib/common"; | |||
import { | |||
Window, ILanguageClient, BaseLanguageClientContribution, Workspace, Languages, LanguageClientFactory | |||
Window, ILanguageClient, BaseLanguageClientContribution, Workspace, Languages, LanguageClientFactory |
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.
Could you check your formatting setting please? It is 4 spaces for ts files.
For VS code we have it checked in: https://github.com/theia-ide/theia/blob/e41a77e57de7f5948e3c61cfe5f5f724b6e2fac1/.vscode/settings.json#L41
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.
Naturally I use Theia to develop Theia. I think it is odd that we are depending on VSCode on these.
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.
very good :) but Theia defaults is 4 spaces: https://github.com/theia-ide/theia/blob/f4de4f572bdebd7dadae5e7a3323e39fb346d566/packages/editor/src/browser/editor-preferences.ts#L24
We can check in .theia/setting.json
as well.
Promise.all( | ||
[this.startSocketServer()] | ||
).then(servers => { | ||
const [server] = servers; |
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.
Minor: perhaps, you could get rid of the array of servers and the Promise.all
as well if we have one, right? And write
this.startSocketServer().then(server => {
// blabla
});
instead.
@gorkem I gave this PR a quick try on Linux. I can confirm that now "Format Document" seems to work, and it did not on master. However the diagnostics, at least on Linux, seem broken. Whatever I type, it seems that no new error markers are created ("old" ones I think were saved in the browser and restored but can't be cleared by fixing the issue). That works better on master. Completion seems not to work as well also, with this PR. |
Actually, not completely broken - the diagnostics seem to kick-in once in a while. |
@marcdumais-work correct. That is because for some reason that I have not discovered yet jdt.ls is not receiveing didOpen/didChange/didClose events. Those events are needed to update the java AST model. At the moment the diagnostics are happening because of a side-effect of other events. |
I have restarted the Windows CI. |
41fb776
to
190e381
Compare
Fixed comments and rebased to master should be ready to go. |
@gorkem what about completion? It still seems not to work well, with the latest version of this PR. However I re-tried on master and it's now not working at all - maybe I was lucky it worked yesterday. So overall this PR is not making things much worse, so no objection from me to merge. I hope you can continue to improve Java LS support. |
BTW the Travis failures seemed unrelated - I have restarted that build. |
@marcdumais-work not working at all is not normal, I will check again. The other oddities are expected because jdt.ls is still not receiving any of the |
@gorkem the completions "not working at all" was when I tried on master today, not with this PR. It was working yesterday for me on master, so maybe something is flaky. |
finally found the culprit. jdt.ls is hitting the bug fixed with TypeFox/vscode-languageserver-node@e0c1f19. @svenefftinge When can we update the library? |
We want to bump to the latest monaco, that would include rebasing this library, as well. But it is a bit more work. But we can for sore make a minor patch release of 'vscode-base-languageclient' that just includes that fix. |
@svenefftinge, may I do the patch release? |
@@ -48,7 +48,7 @@ export class JavaContribution extends BaseLanguageServerContribution { | |||
|
|||
if (DEBUG_MODE) { | |||
args.push( | |||
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044', | |||
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1044', |
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.
@gorkem, do we really want to suspend the Jvm? I guess it's useful to debug the LS handshake. Just asking.
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.
Good catch. It should be fixed 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.
LGTM!
@gorkem, the CI build is passed, do you want to merge? |
OK, I will rebase and merge |
@gorkem, not whether how this is related, but trying out latest changes shows that the java editor is broken. Looking at the errors I see at begins with trying to register Suggestions seems to be off, too: Then I see protocol error messages like:
Do you have any issues? |
@AlexTugarev I think you are hitting an issue that jdt.ls faces time to time. This usually happens when we change eclipse versions or a workspace (the eclipse one) is somewhat corrupted. Deleting the workspace should fix it |
Updates the server to the latest snapshot which includes a fix that is required for Theia. Also changes the way language server is started to adjust to the changes on environment variables. fixes eclipse-theia#1068 Signed-off-by: Gorkem Ercan <[email protected]>
Rebased and updated jdt.ls version |
Thanks for the hint. I’ll try it. |
@gorkem, I tried with fresh project and made sure there is no temp workspace data picked up. The Java editor is still not useable, and it most likely because of the missing But I also still see errors like "java.edit.organizeImports" (with a lot of follow ups). I just verified this by patching Could you check the "java.edit.organizeImports" issue? |
@AlexTugarev Where do you see the
|
|
created #1684 for the multiple command registration issue. |
@gorkem, I've created this issue for JDT LS eclipse-jdtls/eclipse.jdt.ls#629. I think this is responsible for the hiccups, which appears when typing. |
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.
LGTM!
I think we've identified the necessary follow up issues to improve the UX of the Java extension.
Updates the server to the latest snapshot which includes
a fix that is required for Theia. Also changes the way
language server is started to adjust to the changes
on environment variables.
fixes #1068 also improves #1332