Skip to content

Commit 808e545

Browse files
committed
Add check to ensure client is not in running state during activation
1 parent 838429a commit 808e545

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export async function activate(context: vscode.ExtensionContext):
1919

2020
let clangdContext: ClangdContext|null = null;
2121

22-
// An empty place holder for the activate command, otherwise we'll get an
23-
// "command is not registered" error.
2422
context.subscriptions.push(
2523
vscode.commands.registerCommand('clangd.activate', async () => {
26-
// If clangd server is already running, do nothing.
24+
if (clangdContext && clangdContext.clientIsStarting()) {
25+
return;
26+
}
2727
if (clangdContext && clangdContext.clientIsRunning()) {
2828
return;
2929
}

0 commit comments

Comments
 (0)