From b92516f94905c8dd3cfbfc2f7fe8821deacc9cb2 Mon Sep 17 00:00:00 2001 From: Doug Ilijev Date: Mon, 28 Aug 2023 22:54:21 -0700 Subject: [PATCH 1/2] Implement clangd.shutdown to manually deactivate the extension (complement to clangd.activate; first half of clangd.restart). Addresses #512 --- package.json | 5 +++++ src/extension.ts | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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..3b83272c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -16,7 +16,13 @@ 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(); From 5c7bc708c0698f87c0945ae7b47003ba0b9992f9 Mon Sep 17 00:00:00 2001 From: Doug Ilijev Date: Tue, 29 Aug 2023 12:35:04 -0700 Subject: [PATCH 2/2] git-clang-format --- src/extension.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 3b83272c..a7a9a421 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -19,10 +19,8 @@ export async function activate(context: vscode.ExtensionContext) { 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.shutdown', async () => { await clangdContext.dispose(); })); context.subscriptions.push( vscode.commands.registerCommand('clangd.restart', async () => { await clangdContext.dispose();