Skip to content

Commit

Permalink
Add an option to disable hovers (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
HighCommander4 authored Oct 18, 2024
1 parent bfc8c4b commit 983dc88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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

0 comments on commit 983dc88

Please sign in to comment.