Skip to content

Commit

Permalink
Add option to enable/disable clangd
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanplusplus committed Nov 13, 2024
1 parent 4f64ca7 commit ec98aea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
11 changes: 8 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>('enable')) {
await clangdContext.activate(context.globalStoragePath, outputChannel);

shouldCheck = vscode.workspace.getConfiguration('clangd').get<boolean>(
'detectExtensionConflicts') ?? false;
}

const shouldCheck = vscode.workspace.getConfiguration('clangd').get(
'detectExtensionConflicts');
if (shouldCheck) {
const interval = setInterval(function() {
const cppTools = vscode.extensions.getExtension('ms-vscode.cpptools');
Expand Down

0 comments on commit ec98aea

Please sign in to comment.