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 hovers #703

Merged
merged 1 commit into from
Oct 18, 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 @@ -175,6 +175,11 @@
"type": "boolean",
"default": true,
"description": "Enable code completion provided by the language server"
},
"clangd.enableHover": {
"type": "boolean",
"default": true,
"description": "Enable hovers provided by the language server"
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions src/clangd-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ export class ClangdContext implements vscode.Disposable {
})
return new vscode.CompletionList(items, /*isIncomplete=*/ true);
},
provideHover: async (document, position, token, next) => {
if (!config.get<boolean>('enableHover'))
return null;
return next(document, position, token);
},
// VSCode applies fuzzy match only on the symbol name, thus it throws
// away all results if query token is a prefix qualified name.
// By adding the containerName to the symbol name, it prevents VSCode
Expand Down
Loading