You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug,Help] java-code-completion conflicts to vs code code suggestion,maybe a bug #193
Since few days ago(2019-01-25),vs code intellicode does not work nomarlly in java files,i must trigger it using keyboard shorcut.
Finally, find that Spring Boot Tools java-code-completion causes that, it works well after i disabled Spring Boot Tools or remove the config (activationEvents : onLanguage:java) in package.json.
How could i disable java-code-completion or there is other ways.
My English is not good!
Thanks!
If I press ctrl + space to manually trigger suggest, the completion items appear.
backspacesometimes can also trigger the suggest.
See the GIF for details:
Input "S", no completion request sent.
Input "t", no completion request sent.
Backspace, a completion request is sent.
Note
VS Code Insider also works well, following is a comparison of the LSP request/response, left side is 1.30.2, right side is 1.31.0-insider. You can see 1.30.2 doesn't send textDocument/completion request.
It occurs because of the new version "(Spring Boot) added support for deprecated properties (including corresponding quick-fix)"
I have temporarily handled it by modifying the config in "extensions\pivotal.vscode-spring-boot-1.3.0\packge.json" : remove
"activationEvents" : [ "onLanguage:java" ]
I think it's rather because of the completion trigger characters being set for JAVA docs and Boot properties docs... we should find a way to set them for Boot Properties docs only.
we should find a way to set them for Boot Properties docs only.
I fear it is not possible, or at least not easy, because this is configured via server capabilities and it is a single setting that applies for the language server as a whole. It isn't possible to configure this on a per-language basis for a server that handles multiple languages, at least not as the LSP protocol is currently designed. I could be wrong about this, but that's what I remember.
So logically speaking this shouldn't cause a problem for Java. It should trigger completions on typing letters like 'S' or 't' if the trigger characters we configured are being obeyed.
@BoykoAlex I didn't say you are wrong. It does seem plausible to me that the change in trigger characters (we didn't specify these before) somehow has something to do with it. But perhaps its a bug in how the trigger characters are being interpreted by vscode, or vscode language server client. The trigger characters seem to work fine in the context of application.yml file. But in the Java case I guess there are two language servers contributing completions (RedHat's and ours), so maybe that has something to do with it too.
Yeah, I agree with both statements... specified trigger chars shouldn't (ideally, logically) break the pre-1.3.0 behaviour. Something wrong in the JDT LS + Boot LS combination...
In this I have disabled the trigger characters. It seems to make the Java completions work again as before.
Still seems to me that the bug really doesn't lie with us though. The way these trigger characters are being handled seems totally nonsensical. Anyhow... in the interest of avoiding frustration while we try to sort this out, please use that snapshot build.
Note: This build makes Java completions work normally again, but it seems the flip-side of not setting trigger characters on our LS means that completions no longer auto trigger on application.properties and application.yml. You can still get completions there by pressing 'CTRL-space' of course.
I've tweaked the workaround a bit. It now only disables trigger characters when the lsp client is vscode. Since trigger chars seem to work as intended on Eclipse, but not on vscode.
I'm leaving this ticket open since it seems the actual bug is somewhere else and we need to follow up by filing a bug with vscode / vscode-language-server-client.
Also it would be desirable if we could leave trigger characters enabled for vscode since the current 'solution' trades triggering completions automatically for Java, for not triggering them automatically in .properties and .yml files.
I found a solution. I updated the textmate grammars for properties and yaml so that it clasifies the parts of the file where you type property names as 'identifier'. Vscode will auto-trigger completions in those context automatically. And so we can get away with not setting explitcit trigger characters. Everything then seems to works fine.
(comment in Pivotal Tracker added by Martin Lippert:)
I tried VSCode again, using the latest versions of all (VSCode, Java language tooling, Spring Boot extension) and I don't see any conflicts. The content-assist while editing java code is pretty quick, more or less instant, the content-assist in the property editors is just fine, too.
Activity
Eskibear commentedon Jan 31, 2019
Same here.
Steps to Reproduce:
See the GIF for details:
Note
textDocument/completionrequest.Eskibear commentedon Jan 31, 2019
When I install 1.2.0 back, it works. So I believe it should be introduced in 1.3.0
CodingWasaby commentedon Jan 31, 2019
it works bro,this bug bothered me allday,THX.
CodingWasaby commentedon Jan 31, 2019
and this bug still reappeared after u open .properties or .yml once -_-!
BoykoAlex commentedon Jan 31, 2019
I think it's rather because of the completion trigger characters being set for JAVA docs and Boot properties docs... we should find a way to set them for Boot Properties docs only.
kdvolder commentedon Jan 31, 2019
I fear it is not possible, or at least not easy, because this is configured via server capabilities and it is a single setting that applies for the language server as a whole. It isn't possible to configure this on a per-language basis for a server that handles multiple languages, at least not as the LSP protocol is currently designed. I could be wrong about this, but that's what I remember.
That being said, the trigger characters we set are all of the alphabet in upper and lower case and the '.' character. See: https://github.com/spring-projects/sts4/blob/9039a54b2f8e421192d60b0eb3a6d3cca2f92d08/headless-services/spring-boot-language-server/src/main/resources/application.yml#L3
So logically speaking this shouldn't cause a problem for Java. It should trigger completions on typing letters like 'S' or 't' if the trigger characters we configured are being obeyed.
BoykoAlex commentedon Jan 31, 2019
Maybe I'm wrong indeed... perhaps it's something else...
kdvolder commentedon Jan 31, 2019
@BoykoAlex I didn't say you are wrong. It does seem plausible to me that the change in trigger characters (we didn't specify these before) somehow has something to do with it. But perhaps its a bug in how the trigger characters are being interpreted by vscode, or vscode language server client. The trigger characters seem to work fine in the context of
application.ymlfile. But in the Java case I guess there are two language servers contributing completions (RedHat's and ours), so maybe that has something to do with it too.BoykoAlex commentedon Jan 31, 2019
Yeah, I agree with both statements... specified trigger chars shouldn't (ideally, logically) break the pre-1.3.0 behaviour. Something wrong in the JDT LS + Boot LS combination...
Disable trigger characters for boot language server
kdvolder commentedon Jan 31, 2019
For folks who are bothered by this issue. You can download this snapshot build: http://s3-test.spring.io/sts4/vscode-extensions/snapshots/vscode-spring-boot-1.4.0-201901311740.vsix
In this I have disabled the trigger characters. It seems to make the Java completions work again as before.
Still seems to me that the bug really doesn't lie with us though. The way these trigger characters are being handled seems totally nonsensical. Anyhow... in the interest of avoiding frustration while we try to sort this out, please use that snapshot build.
Note: This build makes Java completions work normally again, but it seems the flip-side of not setting trigger characters on our LS means that completions no longer auto trigger on
application.propertiesandapplication.yml. You can still get completions there by pressing 'CTRL-space' of course.Re-instate trigger chars, but not for vscode
kdvolder commentedon Jan 31, 2019
I've tweaked the workaround a bit. It now only disables trigger characters when the lsp client is vscode. Since trigger chars seem to work as intended on Eclipse, but not on vscode.
I'm leaving this ticket open since it seems the actual bug is somewhere else and we need to follow up by filing a bug with vscode / vscode-language-server-client.
Also it would be desirable if we could leave trigger characters enabled for vscode since the current 'solution' trades triggering completions automatically for Java, for not triggering them automatically in
.propertiesand.ymlfiles.20 remaining items
kdvolder commentedon Mar 25, 2019
I found a solution. I updated the textmate grammars for properties and yaml so that it clasifies the parts of the file where you type property names as 'identifier'. Vscode will auto-trigger completions in those context automatically. And so we can get away with not setting explitcit trigger characters. Everything then seems to works fine.
spring-projects-issues commentedon Mar 27, 2019
(comment in Pivotal Tracker added by Martin Lippert:)
I tried VSCode again, using the latest versions of all (VSCode, Java language tooling, Spring Boot extension) and I don't see any conflicts. The content-assist while editing java code is pretty quick, more or less instant, the content-assist in the property editors is just fine, too.