Add command to copy version information
This commit is contained in:
committed by
Andrew Eisenberg
parent
fce9bbce20
commit
8281f408dc
7
.github/ISSUE_TEMPLATE/bug_report.md
vendored
7
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -10,7 +10,12 @@ assignees: ''
|
|||||||
**Describe the bug**
|
**Describe the bug**
|
||||||
A clear and concise description of what the bug is.
|
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 copy version information for the CodeQL extension, click "CodeQL CLI vX.X.X" in the status bar at the bottom of the screen.
|
||||||
|
To copy detailed version information for VS Code itself, see https://code.visualstudio.com/docs/supporting/FAQ#_how-do-i-find-the-version. -->
|
||||||
|
|
||||||
|
**To reproduce**
|
||||||
Steps to reproduce the behavior.
|
Steps to reproduce the behavior.
|
||||||
|
|
||||||
**Expected behavior**
|
**Expected behavior**
|
||||||
|
|||||||
@@ -242,6 +242,10 @@
|
|||||||
"command": "codeQL.openDocumentation",
|
"command": "codeQL.openDocumentation",
|
||||||
"title": "CodeQL: Open Documentation"
|
"title": "CodeQL: Open Documentation"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.copyVersion",
|
||||||
|
"title": "CodeQL: Copy Version Information"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQLDatabases.chooseDatabaseFolder",
|
"command": "codeQLDatabases.chooseDatabaseFolder",
|
||||||
"title": "Choose Database from Folder",
|
"title": "Choose Database from Folder",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
window
|
window
|
||||||
} from 'vscode';
|
} from 'vscode';
|
||||||
import { LanguageClient } from 'vscode-languageclient';
|
import { LanguageClient } from 'vscode-languageclient';
|
||||||
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { testExplorerExtensionId, TestHub } from 'vscode-test-adapter-api';
|
import { testExplorerExtensionId, TestHub } from 'vscode-test-adapter-api';
|
||||||
|
|
||||||
@@ -700,6 +701,14 @@ async function activateWithInstalledDistribution(
|
|||||||
commandRunner('codeQL.openDocumentation', async () =>
|
commandRunner('codeQL.openDocumentation', async () =>
|
||||||
env.openExternal(Uri.parse('https://codeql.github.com/docs/'))));
|
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.');
|
logger.log('Starting language server.');
|
||||||
ctx.subscriptions.push(client.start());
|
ctx.subscriptions.push(client.start());
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class CodeQlStatusBarHandler extends DisposableObject {
|
|||||||
this.push(this.item);
|
this.push(this.item);
|
||||||
this.push(workspace.onDidChangeConfiguration(this.handleDidChangeConfiguration, this));
|
this.push(workspace.onDidChangeConfiguration(this.handleDidChangeConfiguration, this));
|
||||||
this.push(distributionConfigListener.onDidChangeConfiguration(() => this.updateStatusItem()));
|
this.push(distributionConfigListener.onDidChangeConfiguration(() => this.updateStatusItem()));
|
||||||
this.item.command = 'codeQL.openDocumentation';
|
this.item.command = 'codeQL.copyVersion';
|
||||||
this.updateStatusItem();
|
this.updateStatusItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export class CodeQlStatusBarHandler extends DisposableObject {
|
|||||||
|
|
||||||
private async updateStatusItem() {
|
private async updateStatusItem() {
|
||||||
const canary = CANARY_FEATURES.getValue() ? ' (Canary)' : '';
|
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.
|
// meaningful text.
|
||||||
this.item.text = `CodeQL${canary}`;
|
this.item.text = `CodeQL${canary}`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user