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.

Show message to the user in case of language server starting error

See original GitHub issue

Starting a language server via a client.start() can result in an error. Usually the stdout or stderr for the server process contain hints to what the problem could be. In case of such an error while starting the server, the only message displayed to the user is something like:

[Error - 1:33:53 PM] Connection to server got closed. Server will not be restarted.

I wonder if there’s any way to improve the situation and display the stdout/stderr from the server to the user when the language server fails to start. The clientOptions include a errorHandler that can be customized, but that doesn’t seem to help, since when the issue occurs the closed() method does not get any arguments.

Note: I’m not a Typescript / JS developer myself, so there may be something I’m missing.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Nov 15, 2021

The handler now allows to return a message that will be presented to the user with a button to open the output channel (which contains stdout)

1reaction
alanzcommented, Oct 8, 2021

I think Roberto is talking about a scenario where the server is misconfigured, and fails to start.

At the moment you just get an error saying the server did not start, and eventually reports 5 failures and stops.

Perhaps we could have an option when that point is reached to display whatever the server did emit on stdout/stderr somewhere on the client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Extension Guide - Visual Studio Code
Let's build a simple Language Server extension that implements autocomplete and diagnostics for plain text files. We will also cover the syncing of ......
Read more >
Developing a Minimal Language Server for the Frege ...
Firstly, I port the example server from Typescript to Java and secondly, I integrate the Frege compiler to show compiler errors and type...
Read more >
Lsp - Neovim docs
Nvim supports the Language Server Protocol (LSP), which means it acts as a client to ... window/showMessage window/showDocument window/showMessageRequest ...
Read more >
Fortran language server (fortls) error in VSCode (Windows)
I confirmed what mo_sal observed in his case. I installed Modern-Fortran extension (v3.4.2022111811) on ...
Read more >
A Language Server For DOT With Visual Studio Code
The editor will then take care of communicating the mistake to the user, usually by underlining the text. But nothing forbids the client...
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