question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(Extension API) Detecting if language server will launch in Standard Mode during extension activation

See original GitHub issue

For 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:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fbriconcommented, Aug 19, 2020
1reaction
jdneocommented, Aug 12, 2020

Great, and please let us know if you have any other request about the API.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Extension Guide - Visual Studio Code
Learn how to create Language Servers to provide rich language features in Visual Studio Code.
Read more >
Example language server - vscode-docs
This section tells VS Code to activate the extension as soon as a plain text file is opened (e.g. a file with the...
Read more >
Adding a Language Server Protocol extension - Visual Studio ...
Learn how to create a Visual Studio extension that integrates a language server based on the Language Server Protocol (LSP).
Read more >
Deep dive on Ansible VScode extension
The Ansible Language Server is released as a node module on the npm ... language server protocol, while the VSCode extension client was...
Read more >
User Manual - rust-analyzer
The server binary is stored in the extension install directory, which starts with ... If rust-analyzer is not detected, Corrosion will prompt you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found