diff --git a/package.json b/package.json index e772f1ac..e25ceada 100644 --- a/package.json +++ b/package.json @@ -202,6 +202,11 @@ "category": "clangd", "title": "Manually activate extension" }, + { + "command": "clangd.shutdown", + "category": "clangd", + "title": "Manually shutdown extension" + }, { "command": "clangd.restart", "category": "clangd", diff --git a/src/extension.ts b/src/extension.ts index 1cfaa564..a7a9a421 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -16,7 +16,11 @@ export async function activate(context: vscode.ExtensionContext) { // An empty place holder for the activate command, otherwise we'll get an // "command is not registered" error. context.subscriptions.push( - vscode.commands.registerCommand('clangd.activate', async () => {})); + vscode.commands.registerCommand('clangd.activate', async () => { + await clangdContext.activate(context.globalStoragePath, outputChannel); + })); + context.subscriptions.push(vscode.commands.registerCommand( + 'clangd.shutdown', async () => { await clangdContext.dispose(); })); context.subscriptions.push( vscode.commands.registerCommand('clangd.restart', async () => { await clangdContext.dispose();