This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
feat(vscode): add a status bar item for the language server #3139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Related to #3006
Currently users of the VSCode extension have little to no feedback on whether the extension is active or not for the current file, or on the status of the language server. Taking inspiration from rust-analyzer and Prettier, this PR adds a status bar item for Rome that displays different state when the server is starting up, is ready and active, is inactive because Rome doesn't support the current document (currently this is done at the extension level by checking if the document matches the language selector for the extension, in the future we may request additional information to the language server and display the status of individual features like linting or formatting), or has crashed repeatedly. Additionally, clicking on the status bar item will open the "Rome Trace" log channel in the VSCode output panel
Screenshots
Pending:
Ready:
Inactive:
Error:
Test Plan
The extension doesn't have automated tests, so I built it and installed it locally and tried switching between supported and unsupported documents, as well as killing the server process 5 times so the extension gave up on respawning it and went into the error state.