From 983dc88c308dc6065de8a29114f82f2938712dc7 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Thu, 17 Oct 2024 21:45:43 -0400 Subject: [PATCH] Add an option to disable hovers (#703) --- package.json | 5 +++++ src/clangd-context.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/package.json b/package.json index 163607b..c03477c 100644 --- a/package.json +++ b/package.json @@ -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" } } }, diff --git a/src/clangd-context.ts b/src/clangd-context.ts index 9fc40a4..51beadb 100644 --- a/src/clangd-context.ts +++ b/src/clangd-context.ts @@ -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('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