diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 386afb1a49a..7df2ea5ea4e 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Avoid showing a popup when hovering over source elements in database source files. [#3125](https://github.com/github/vscode-codeql/pull/3125) + ## 1.11.0 - 13 December 2023 - Add a new method modeling panel to classify methods as sources/sinks/summaries while in the context of the source code. [#3128](https://github.com/github/vscode-codeql/pull/3128) @@ -19,7 +21,7 @@ - Add new CodeQL views for managing databases and queries: 1. A queries panel that shows all queries in your workspace. It allows you to view, create, and run queries in one place. 2. A language selector, which allows you to quickly filter databases and queries by language. - + For more information, see the [documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/analyzing-your-projects/#filtering-databases-and-queries-by-language). - When adding a CodeQL database, we no longer add the database source folder to the workspace by default (since this caused bugs in single-folder workspaces). [#3047](https://github.com/github/vscode-codeql/pull/3047) - You can manually add individual database source folders to the workspace with the "Add Database Source to Workspace" right-click command in the databases view. diff --git a/extensions/ql-vscode/src/extension.ts b/extensions/ql-vscode/src/extension.ts index 6c14893c458..6fd399b0ec5 100644 --- a/extensions/ql-vscode/src/extension.ts +++ b/extensions/ql-vscode/src/extension.ts @@ -1086,23 +1086,27 @@ async function activateWithInstalledDistribution( // Jump-to-definition and find-references void extLogger.log("Registering jump-to-definition handlers."); - languages.registerDefinitionProvider( - { scheme: zipArchiveScheme }, - new TemplateQueryDefinitionProvider( - cliServer, - qs, - dbm, - contextualQueryStorageDir, + ctx.subscriptions.push( + languages.registerDefinitionProvider( + { scheme: zipArchiveScheme }, + new TemplateQueryDefinitionProvider( + cliServer, + qs, + dbm, + contextualQueryStorageDir, + ), ), ); - languages.registerReferenceProvider( - { scheme: zipArchiveScheme }, - new TemplateQueryReferenceProvider( - cliServer, - qs, - dbm, - contextualQueryStorageDir, + ctx.subscriptions.push( + languages.registerReferenceProvider( + { scheme: zipArchiveScheme }, + new TemplateQueryReferenceProvider( + cliServer, + qs, + dbm, + contextualQueryStorageDir, + ), ), ); diff --git a/extensions/ql-vscode/src/language-support/contextual/template-provider.ts b/extensions/ql-vscode/src/language-support/contextual/template-provider.ts index 6fb661b714b..8f9098ebb62 100644 --- a/extensions/ql-vscode/src/language-support/contextual/template-provider.ts +++ b/extensions/ql-vscode/src/language-support/contextual/template-provider.ts @@ -88,25 +88,18 @@ export class TemplateQueryDefinitionProvider implements DefinitionProvider { uriString: string, token: CancellationToken, ): Promise { - return withProgress( - async (progress, tokenInner) => { - const multiToken = new MultiCancellationToken(token, tokenInner); - return getLocationsForUriString( - this.cli, - this.qs, - this.dbm, - uriString, - KeyType.DefinitionQuery, - this.queryStorageDir, - progress, - multiToken, - (src, _dest) => src === uriString, - ); - }, - { - cancellable: true, - title: "Finding definitions", - }, + // Do not create a multitoken here. There will be no popup and users cannot click on anything to cancel this operation. + // This is because finding definitions can be triggered by a hover, which should not have a popup. + return getLocationsForUriString( + this.cli, + this.qs, + this.dbm, + uriString, + KeyType.DefinitionQuery, + this.queryStorageDir, + () => {}, // noop + token, + (src, _dest) => src === uriString, ); } } @@ -161,6 +154,7 @@ export class TemplateQueryReferenceProvider implements ReferenceProvider { uriString: string, token: CancellationToken, ): Promise { + // Create a multitoken here. There will be a popup and users can click on it to cancel this operation. return withProgress( async (progress, tokenInner) => { const multiToken = new MultiCancellationToken(token, tokenInner);