Skip to content
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

Provide an advanced LSP console #745

Open
angelozerr opened this issue Aug 5, 2023 · 2 comments
Open

Provide an advanced LSP console #745

angelozerr opened this issue Aug 5, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Aug 5, 2023

I had started an issue at #631 but I create a new one which is focus on LSP console.

I would like to try to convince you that a robust LSP console is really important to have.

I spend so many time to work on LSP console developement for IJ and it help us a lot. You can see the status of the server when it is starting, started, stopping,stopped or crash, see the pid, see the LSP messages, etc

Here a little demo which show the language servers which are available and you can see the status of each language server (when it is starting etc). The demo shows the LSP request / response received when the LSP hover is processed:

LSPConsoleInIJ

The LSP console shows:

  • the language servers which are available
  • the status of each server. You can pause (stop the process) or stop (disable the language server) with menu context
    image
  • the pid of the language server
  • you can copy/paste the command which starts the language server
  • the LSP request / response messages are formatted correctly and there is folding
    image
  • there is a search field:
    image

I know it is a long task, but IMHO LSP4E should provide this kind of LSP console which are very helpfull for 3 profiles:

  • the LSP4E developer who develop LSP client. You will understand more what it happens and you should discover some bugs that you have not though. In my case I have ported LSP4E on IJ and I discover some bugs where the server was restarted although it should not (ex : when I closed a workspace). It will be very helpfull to implement new features like cancel support; You could check with the search field that $cancel request will be send correctly for instance. The current console is very hard to use it, since the LSP messages is not formatted. The LSP message format should follow the spec and have the same format than vscode.

  • the LSP language server developer: when you develop a language server, you need to understand which data you send and check that you don't send too many response and when there is a bug, LSP console is your friend, you understand more what it happens.

  • the Users who use a language server: we spend so many time to assist user with problems and spend so many times to explain the process "please activate your log with this settings etc". With LSP console you don't need to explain that for assisting user, with LSP console it is very easy to have an overview (the server is started? the LSP messages appears correctly?).

  • the Copy Start command can help if the language server cannot be started:

image

A good sample of issue which is a nightmare is jbosstools/jbosstools-quarkus#235

java.util.concurrent.ExecutionException: org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) at

We don't know if the problem comes from the start command or if the language server can be started, but fails after. We have no overview of what it happens.

I know it is a long task to implement this kind of LSP console, but IMHO it is a requirement for LSP client developpers, LSP server developers and Users.

@mickaelistria
Copy link
Contributor

There is now #519 which gives some access to running LS instances. Log could be incorporated here. I still think the "stream" log can be useful as it can happen that some LS have transport bugs that cannot be detected without looking at the actual IO. Adding a message-level log (with formatting and so on) would be good as well.

@angelozerr
Copy link
Contributor Author

angelozerr commented Sep 7, 2023

When language server cannot start, it is a real nightmare to understand the problem:

  1. You don't know that language server cannot be started
  2. You have so many freeze, because it tries to start again and again the language server.

In LSP4IJ, I have managed that redhat-developer/intellij-quarkus#1051 (comment)

  • when language server cannot be started, you can see error in the LSP console
  • after 50 attempt, the language server is disabled.

Here a demo when language server cannot be started:

256339025-33fe02db-3988-4def-9c8e-981e4be90f7e

IMHO, LSP4E should provide this feature. Here a very good sample of kind of issues that you can have in a language server project:

which are totally different but the main problem is because the language server cannot be started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants