diff options
| author | bors <bors@rust-lang.org> | 2023-04-28 19:35:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-28 19:35:05 +0000 |
| commit | 370b72c7dd3dcdb1efe92224ab1622e44639cb07 (patch) | |
| tree | b07394cf3f5cca17ffffa24b22c3899ff6d0448a /editors/code/src | |
| parent | 3ad835faa97030011e66eb83092f7fb1e3201e2b (diff) | |
| parent | cf8f13b531f649e37202780c7f6353db911062ba (diff) | |
| download | rust-370b72c7dd3dcdb1efe92224ab1622e44639cb07.tar.gz rust-370b72c7dd3dcdb1efe92224ab1622e44639cb07.zip | |
Auto merge of #14678 - Veykril:restart-server, r=Veykril
fix: Fix restart server button trying to start instead of restart the server
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/config.ts | 5 | ||||
| -rw-r--r-- | editors/code/src/ctx.ts | 4 | ||||
| -rw-r--r-- | editors/code/src/main.ts | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index da7c74c28ba..d6b8cc7a56a 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -21,7 +21,6 @@ export class Config { "serverPath", "server", "files", - "lens", // works as lens.* ].map((opt) => `${this.rootSection}.${opt}`); readonly package: { @@ -70,7 +69,7 @@ export class Config { if (!requiresReloadOpt) return; if (this.restartServerOnConfigChange) { - await vscode.commands.executeCommand("rust-analyzer.reload"); + await vscode.commands.executeCommand("rust-analyzer.restartServer"); return; } @@ -78,7 +77,7 @@ export class Config { const userResponse = await vscode.window.showInformationMessage(message, "Restart now"); if (userResponse) { - const command = "rust-analyzer.reload"; + const command = "rust-analyzer.restartServer"; await vscode.commands.executeCommand(command); } } diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 0ffa42c2a5a..567b9216bc1 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -390,7 +390,9 @@ export class Ctx { statusBar.tooltip.appendMarkdown( "\n\n[Rebuild Proc Macros](command:rust-analyzer.rebuildProcMacros)" ); - statusBar.tooltip.appendMarkdown("\n\n[Restart server](command:rust-analyzer.startServer)"); + statusBar.tooltip.appendMarkdown( + "\n\n[Restart server](command:rust-analyzer.restartServer)" + ); statusBar.tooltip.appendMarkdown("\n\n[Stop server](command:rust-analyzer.stopServer)"); if (!status.quiescent) icon = "$(sync~spin) "; statusBar.text = `${icon}rust-analyzer`; diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index de40f99e003..6c990f804b0 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -120,13 +120,11 @@ function createCommands(): Record<string, CommandFactory> { enabled: commands.onEnter, disabled: (_) => () => vscode.commands.executeCommand("default:type", { text: "\n" }), }, - reload: { + restartServer: { enabled: (ctx) => async () => { - void vscode.window.showInformationMessage("Reloading rust-analyzer..."); await ctx.restart(); }, disabled: (ctx) => async () => { - void vscode.window.showInformationMessage("Reloading rust-analyzer..."); await ctx.start(); }, }, |
