From ec98aeac9fa62275fbe5b6b513d65eb0ca4ee2ae Mon Sep 17 00:00:00 2001 From: Ryan Hartlage Date: Wed, 5 Jun 2024 16:53:05 -0400 Subject: [PATCH] Add option to enable/disable clangd --- package.json | 5 +++++ src/extension.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c03477c..561e2eb 100644 --- a/package.json +++ b/package.json @@ -180,6 +180,11 @@ "type": "boolean", "default": true, "description": "Enable hovers provided by the language server" + }, + "clangd.enable": { + "type": "boolean", + "default": true, + "description": "Enable clangd language server features" } } }, diff --git a/src/extension.ts b/src/extension.ts index 94e56ca..b422438 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -41,10 +41,15 @@ export async function activate(context: vscode.ExtensionContext): } })); - await clangdContext.activate(context.globalStoragePath, outputChannel); + let shouldCheck = false; + + if (vscode.workspace.getConfiguration('clangd').get('enable')) { + await clangdContext.activate(context.globalStoragePath, outputChannel); + + shouldCheck = vscode.workspace.getConfiguration('clangd').get( + 'detectExtensionConflicts') ?? false; + } - const shouldCheck = vscode.workspace.getConfiguration('clangd').get( - 'detectExtensionConflicts'); if (shouldCheck) { const interval = setInterval(function() { const cppTools = vscode.extensions.getExtension('ms-vscode.cpptools');