Skip to content

Improve error discovery when the LSP process cannot be started #142

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

Merged
merged 1 commit into from
Sep 16, 2019
Merged

Improve error discovery when the LSP process cannot be started #142

merged 1 commit into from
Sep 16, 2019

Conversation

robertrossmann
Copy link
Contributor

When the bash-language-server cannot be started or found the user only sees a message that the process could not be found instead of seeing the actual reason for the failure.

This message got me very confused when I installed the extension because I made sure I had the bash-language-server installed and could find it in my PATH but I thought VS Code somehow fails to find it. The actual problem was that I upgraded to Node.js 12 and the process failed to start as it was not compiled against the correct Node.js version. I only discovered that when I actually tried to start the server.

This PR improves the discovery of the failure by showing a more generic error message and guiding users to the DevTools console where the actual error is logged.

@skovhus
Copy link
Collaborator

skovhus commented Sep 2, 2019

Thanks! Can you run a yarn run lint and amend the formatting changes?

@robertrossmann
Copy link
Contributor Author

robertrossmann commented Sep 2, 2019

Hi @skovhus, fixed and force-pushed! 🎉

I also updated the console.log statement to console.error to show the problem in red in the console, since it's really an error if the extension is unable to start.

@skovhus skovhus self-requested a review September 2, 2019 09:36
Copy link
Collaborator

@skovhus skovhus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@skovhus skovhus merged commit ca55168 into bash-lsp:master Sep 16, 2019
@robertrossmann robertrossmann deleted the fix/show-correct-error branch September 16, 2019 14:00
@HsunGong
Copy link

That's good, is it showing error info in output or debug-console ? May change more info in this hint.

@robertrossmann
Copy link
Contributor Author

@HsunGong the full stack trace and error message will be visible in the DevTools console in VS Code.

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

Successfully merging this pull request may close these issues.

3 participants