feat(editors): add Restart LSP Server command
MODIFY
editors/vscode/package.json
editors/vscode/package.json
"command": "rome.syntaxTree",
"title": "Show Syntax Tree",
"category": "Rome"
+ },
+ {
+ "command": "rome.restartLspServer",
+ "title": "Restart LSP Server",
+ "category": "Rome"
}
],
"menus": {

MODIFY
editors/vscode/src/commands/index.ts
editors/vscode/src/commands/index.ts
// list of commands available in the VS Code extension
export enum Commands {
+ RestartLspServer = "rome.restartLspServer",
SyntaxTree = "rome.syntaxTree",
ServerStatus = "rome.serverStatus",
}

MODIFY
editors/vscode/src/main.ts
editors/vscode/src/main.ts
@@ -81,6 +81,11 @@ export async function activate(context: ExtensionContext) {
session.registerCommand(Commands.ServerStatus, () => {
traceOutputChannel.show();
});
+ session.registerCommand(Commands.RestartLspServer, () => {
+ client.restart().catch((error) => {
+ client.error("Restarting client failed", error, "force");
+ });
+ });
context.subscriptions.push(
client.onDidChangeState((evt) => {

feat(editors): add Restart LSP Server command (#3533)