Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Allow restart command to fail gracefully#420

Merged
vinistock merged 1 commit intomainfrom
vs/prevent_commands_from_failing
Mar 2, 2023
Merged

Allow restart command to fail gracefully#420
vinistock merged 1 commit intomainfrom
vs/prevent_commands_from_failing

Conversation

@vinistock
Copy link
Copy Markdown
Member

Closes Shopify/ruby-lsp#1483

If we let commands raise, VS Code won't let you use them again without reloading the window completely. That's not super helpful and we should rather catch the error and log it in the output channel.

Also, as accurately pointed out by Ufuk #385 (comment), declaring a function as async and then only doing await inside of them has no difference when compared to just returning the function straight away. The behaviour will depend on whether the consumer of the function is awaiting or not (in this case VS Code). So I switched to a less verbose implementation.

@vinistock vinistock requested a review from a team as a code owner February 28, 2023 21:14
@vinistock vinistock self-assigned this Feb 28, 2023
Comment thread src/client.ts Outdated
@vinistock vinistock force-pushed the vs/prevent_commands_from_failing branch from 836f84d to 49eb39d Compare March 1, 2023 21:34
@vinistock vinistock merged commit 2bc5056 into main Mar 2, 2023
@vinistock vinistock deleted the vs/prevent_commands_from_failing branch March 2, 2023 14:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent failed ruby-lsp command execution from crashing the extension

3 participants