(Extension API) Detecting if language server will launch in Standard Mode during extension activation
See original GitHub issueFor MicroProfile tools for vscode (https://github.com/redhat-developer/vscode-microprofile) we require that the java language server is started in standard mode, and we want to display a warning / prompt users to switch to standard if they are in lightweight. We want to do this when MicroProfile tools activates before it launches its own language server that depends on vscode-java.
I am wondering the best way to do this.
Looking at the serverMode
from vscode-java’s api (https://github.com/redhat-developer/vscode-java/blob/master/src/extension.api.ts#L103). Before a project has been imported serverMode
is returned as LightWeight
initially and then switches over to Standard
later if the user selects to import the project. So if i am checking for LightWeight while MicroProfile tools is starting up and display a warning, the user gets an unnecessary warning while the language server is starting up. Because MicroProfile tools will see that the user is in LightWeight
mode and display a warning to switch to Standard
when really the Standard mode server is in the process of being launched.
I also looked at using the java.server.launchMode
setting to see if it is set to lightweight, since for the most part if it is set to Hybrid
or Standard
the language server will eventually end up in standard mode. The one problem I see with this is that before a project is imported if someone has their launch mode set to hybrid, and they decide to click import later i think the server will stay in lightweight mode. So vscode-microprofile will not work and they would not get an error message in that case since the java.server.launchMode
is set to Hybrid
Is there a way to detect if the java language server has launched in standard more or is in the process of launching in standard mode so I do not need to display a warning to the user.
@fbricon mentioned that @testforstephen, @jdneo and @Eskibear may be able to provide some guidance
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
@rzgry you can try https://download.jboss.org/jbosstools/jdt.ls/staging/java-0.66.0-2398.vsix, which contains the fix from #1581
Great, and please let us know if you have any other request about the API.