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
[vscode extension] not work when change LightWeight mode to Standard #628
I am not exactly sure what you mean with Lightweight vs. Standard mode? Can you elaborate on this or provide a few screenshots or anything that describes the issue in more detail? That would be great.
Thanks for the screenshot, that helps. What exactly are the steps that you follow to reproduce the problem? Did you select the Lightweight mode in the preferences, import the project, and then switch this preference manually to Standard? Or do you trigger this in a different way?
Situtation 1:
Mode is set to Standard default, open a project, and STS work well.
Situtation 2:
Mode is set to LightWeight default, open a project, change mode to Standard manually (use the button on bottom-right of vscode, see the screenshot), and STS not work.
@caiqichang The Spring Boot Dashboard extension interacts with the Spring Boot Tools in order to gather information about the apps to show, so I assume the issue with the Spring Boot Dashboard goes back to the underlying issue with the Spring Tools extension.
I'm not sure one should expect the extension to work when Java is set to lightweight. I suspect in lightweight mode we are not getting classpath information which our extension needs to do anything. I think this is probably 'by design' as the screenshot seems to say that 'Gradle / Maven' support is part of the 'full mode' and that is where classpath information comes from as well.
We can have a deeper look at this but I suspect that there is not much that can be done here. Essentially I think that by selecting 'light weight mode' you are deliberately opting out of 'expensive' features that require classpath resolution. This includes the support you get from our editor. E.g. completions in properties and yaml editor only work because they can obtain metadata from project classpath.
Sounded to me like we'd like to fix the default case where Light-weight JDT LS starts first and then somehow replaced with the Standard when it is fully started. The issue is when the standard LS is fully functional we won't attempt to register classpath listener again or don't wait for standard jdt ls to start when registering classpath listener
Hmm, okay. Yes, as a user I would expect that to work, and it should be possible somehow to make that work.
The question is though how would our extension be able to even know that the JDT server's 'mode' was changed and therefore we need to try again to connect our classpath listeners. I suppose we could just 'keep trying' repeatedly no matter what, but that might not be such a great idea for performance reasons.
Red Hat Java 0.79.1 seems to have it fixed by prompting the user to restart vscode for launch mode setting switch. After that restart everything works as expected.
Please double -check this @caiqichang
I am re-opening this issue. To be it looks like this still doesn't work when you start VS Code with the Java support to be configured to launch in Lightweight mode. I then open a Java file and I can see in the outline view the Java content (which is correct). When I switch via the preferences to a different mode, I am prompted for a restart and everything works just fine. But if I switch to the standard mode via the little rocket icon on the status bar below the editor, I am prompted if I really want to enable the standard mode, and if I click yes, the Java support is switched to the standard mode, but the Spring Boot support isn't notified of anything, so continues to do nothing.
Doesn't look like we can avoid adding/removing classpath listener to jdt ls at runtime.
JDT launches two kinds of LS now: syntax and standard. We can either add classpath listener to both because syntax server is shutdown if standard started or just add a listener to the standard ls (which is done in the current solution).
If the launch mode is hybrid syntax ls started first then once standard ls is started the launchMode property becomes Standard and then boot ls adds a classpath listener.
(@martinlippert Hope this tiny bit of explanation makes sense, but we can obviously chat more about it ouitside of github)
Activity
martinlippert commentedon Apr 27, 2021
I am not exactly sure what you mean with Lightweight vs. Standard mode? Can you elaborate on this or provide a few screenshots or anything that describes the issue in more detail? That would be great.
caiqichang commentedon Apr 27, 2021
@martinlippert

It is property of extension
Language Support for Java(TM) by Red Hat( dependency ofSpring Boot Tools).martinlippert commentedon Apr 27, 2021
Thanks for the screenshot, that helps. What exactly are the steps that you follow to reproduce the problem? Did you select the
Lightweightmode in the preferences, import the project, and then switch this preference manually toStandard? Or do you trigger this in a different way?caiqichang commentedon Apr 27, 2021
@martinlippert
Situtation 1:
Mode is set to
Standarddefault, open a project, and STS work well.Situtation 2:
Mode is set to
LightWeightdefault, open a project, change mode toStandardmanually (use the button on bottom-right of vscode, see the screenshot), and STS not work.martinlippert commentedon Apr 27, 2021
@caiqichang Yepp, I can reproduce, thanks for reporting and the additional details. We will take a look.
caiqichang commentedon Apr 28, 2021
@martinlippert
I found that other extension like
Spring Boot Dashboardalso has this problem, maybe it should be fixed by upstream.martinlippert commentedon Apr 28, 2021
@caiqichang The
Spring Boot Dashboardextension interacts with the Spring Boot Tools in order to gather information about the apps to show, so I assume the issue with theSpring Boot Dashboardgoes back to the underlying issue with the Spring Tools extension.kdvolder commentedon May 7, 2021
I'm not sure one should expect the extension to work when Java is set to lightweight. I suspect in lightweight mode we are not getting classpath information which our extension needs to do anything. I think this is probably 'by design' as the screenshot seems to say that 'Gradle / Maven' support is part of the 'full mode' and that is where classpath information comes from as well.
We can have a deeper look at this but I suspect that there is not much that can be done here. Essentially I think that by selecting 'light weight mode' you are deliberately opting out of 'expensive' features that require classpath resolution. This includes the support you get from our editor. E.g. completions in properties and yaml editor only work because they can obtain metadata from project classpath.
BoykoAlex commentedon May 7, 2021
Sounded to me like we'd like to fix the default case where Light-weight JDT LS starts first and then somehow replaced with the Standard when it is fully started. The issue is when the standard LS is fully functional we won't attempt to register classpath listener again or don't wait for standard jdt ls to start when registering classpath listener
kdvolder commentedon May 7, 2021
Hmm, okay. Yes, as a user I would expect that to work, and it should be possible somehow to make that work.
The question is though how would our extension be able to even know that the JDT server's 'mode' was changed and therefore we need to try again to connect our classpath listeners. I suppose we could just 'keep trying' repeatedly no matter what, but that might not be such a great idea for performance reasons.
BoykoAlex commentedon May 12, 2021
Red Hat Java 0.79.1 seems to have it fixed by prompting the user to restart vscode for launch mode setting switch. After that restart everything works as expected.
Please double -check this @caiqichang
martinlippert commentedon Jun 2, 2021
I am re-opening this issue. To be it looks like this still doesn't work when you start VS Code with the Java support to be configured to launch in Lightweight mode. I then open a Java file and I can see in the outline view the Java content (which is correct). When I switch via the preferences to a different mode, I am prompted for a restart and everything works just fine. But if I switch to the standard mode via the little rocket icon on the status bar below the editor, I am prompted if I really want to enable the standard mode, and if I click yes, the Java support is switched to the standard mode, but the Spring Boot support isn't notified of anything, so continues to do nothing.
BoykoAlex commentedon Jun 3, 2021
Fixed with 94dd78b
Doesn't look like we can avoid adding/removing classpath listener to jdt ls at runtime.
JDT launches two kinds of LS now: syntax and standard. We can either add classpath listener to both because syntax server is shutdown if standard started or just add a listener to the standard ls (which is done in the current solution).
If the launch mode is hybrid syntax ls started first then once standard ls is started the launchMode property becomes Standard and then boot ls adds a classpath listener.
(@martinlippert Hope this tiny bit of explanation makes sense, but we can obviously chat more about it ouitside of github)