Skip to content

Commit 91022b2

Browse files
authored
Add option to enable/disable clangd (#636)
1 parent 4f64ca7 commit 91022b2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@
180180
"type": "boolean",
181181
"default": true,
182182
"description": "Enable hovers provided by the language server"
183+
},
184+
"clangd.enable": {
185+
"type": "boolean",
186+
"default": true,
187+
"description": "Enable clangd language server features"
183188
}
184189
}
185190
},

src/extension.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ export async function activate(context: vscode.ExtensionContext):
4141
}
4242
}));
4343

44-
await clangdContext.activate(context.globalStoragePath, outputChannel);
44+
let shouldCheck = false;
45+
46+
if (vscode.workspace.getConfiguration('clangd').get<boolean>('enable')) {
47+
await clangdContext.activate(context.globalStoragePath, outputChannel);
48+
49+
shouldCheck = vscode.workspace.getConfiguration('clangd').get<boolean>(
50+
'detectExtensionConflicts') ??
51+
false;
52+
}
4553

46-
const shouldCheck = vscode.workspace.getConfiguration('clangd').get(
47-
'detectExtensionConflicts');
4854
if (shouldCheck) {
4955
const interval = setInterval(function() {
5056
const cppTools = vscode.extensions.getExtension('ms-vscode.cpptools');

0 commit comments

Comments
 (0)