diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 80ee2822654..88719291dfa 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,7 +10,12 @@ assignees: '' **Describe the bug** A clear and concise description of what the bug is. -**To Reproduce** +**Version** +The CodeQL and VS Code version in which the bug occurs. + + +**To reproduce** Steps to reproduce the behavior. **Expected behavior** diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 43ebd9058d9..287643815d7 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,7 @@ ## [UNRELEASED] +- Copy version information to the clipboard when a user clicks the CodeQL section of the status bar. [#845](https://github.com/github/vscode-codeql/pull/845) - Ensure changes in directories that contain tests will be properly updated in the test explorer. [#846](https://github.com/github/vscode-codeql/pull/846) ## 1.4.7 - 23 April 2021 diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 3bc83976364..dfbe4f2e421 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -242,6 +242,10 @@ "command": "codeQL.openDocumentation", "title": "CodeQL: Open Documentation" }, + { + "command": "codeQL.copyVersion", + "title": "CodeQL: Copy Version Information" + }, { "command": "codeQLDatabases.chooseDatabaseFolder", "title": "Choose Database from Folder", diff --git a/extensions/ql-vscode/src/extension.ts b/extensions/ql-vscode/src/extension.ts index ec76182c14d..1eb228f3389 100644 --- a/extensions/ql-vscode/src/extension.ts +++ b/extensions/ql-vscode/src/extension.ts @@ -13,6 +13,7 @@ import { window } from 'vscode'; import { LanguageClient } from 'vscode-languageclient'; +import * as os from 'os'; import * as path from 'path'; import { testExplorerExtensionId, TestHub } from 'vscode-test-adapter-api'; @@ -700,6 +701,14 @@ async function activateWithInstalledDistribution( commandRunner('codeQL.openDocumentation', async () => env.openExternal(Uri.parse('https://codeql.github.com/docs/')))); + ctx.subscriptions.push( + commandRunner('codeQL.copyVersion', async () => { + const text = `CodeQL extension version: ${extension?.packageJSON.version} \nCodeQL CLI version: ${await cliServer.getVersion()} \nPlatform: ${os.platform()} ${os.arch()}`; + env.clipboard.writeText(text); + helpers.showAndLogInformationMessage(text); + })); + + logger.log('Starting language server.'); ctx.subscriptions.push(client.start()); diff --git a/extensions/ql-vscode/src/status-bar.ts b/extensions/ql-vscode/src/status-bar.ts index b9ecbb6914f..78ac9a9b63c 100644 --- a/extensions/ql-vscode/src/status-bar.ts +++ b/extensions/ql-vscode/src/status-bar.ts @@ -19,7 +19,7 @@ export class CodeQlStatusBarHandler extends DisposableObject { this.push(this.item); this.push(workspace.onDidChangeConfiguration(this.handleDidChangeConfiguration, this)); this.push(distributionConfigListener.onDidChangeConfiguration(() => this.updateStatusItem())); - this.item.command = 'codeQL.openDocumentation'; + this.item.command = 'codeQL.copyVersion'; this.updateStatusItem(); } @@ -37,7 +37,7 @@ export class CodeQlStatusBarHandler extends DisposableObject { private async updateStatusItem() { const canary = CANARY_FEATURES.getValue() ? ' (Canary)' : ''; - // since getting the verison may take a few seconds, initialize with some + // since getting the version may take a few seconds, initialize with some // meaningful text. this.item.text = `CodeQL${canary}`;