Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to disable code completion #591

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@
"type": "number",
"default": 0.55,
"description": "Opacity of inactive regions (used only if clangd.inactiveRegions.useBackgroundHighlight=false)"
},
"clangd.enableCodeCompletion": {
"type": "boolean",
"default": true,
"description": "Enable code completion provided by the language server"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions src/clangd-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export class ClangdContext implements vscode.Disposable {
middleware: {
provideCompletionItem: async (document, position, context, token,
next) => {
if (!config.get<boolean>('enableCodeCompletion'))
return new vscode.CompletionList([], /*isIncomplete=*/ false);
let list = await next(document, position, context, token);
if (!config.get<boolean>('serverCompletionRanking'))
return list;
Expand Down
Loading