Merge branch 'main' into robertbrignull/remoteResultsItemWithoutLogs
This commit is contained in:
2
.github/codeql/codeql-config.yml
vendored
2
.github/codeql/codeql-config.yml
vendored
@@ -2,6 +2,8 @@ name: "CodeQL config"
|
|||||||
queries:
|
queries:
|
||||||
- name: Run standard queries
|
- name: Run standard queries
|
||||||
uses: security-and-quality
|
uses: security-and-quality
|
||||||
|
- name: Experimental queries
|
||||||
|
uses: security-experimental
|
||||||
- name: Run custom javascript queries
|
- name: Run custom javascript queries
|
||||||
uses: ./.github/codeql/queries
|
uses: ./.github/codeql/queries
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# CodeQL for Visual Studio Code: Changelog
|
# CodeQL for Visual Studio Code: Changelog
|
||||||
|
|
||||||
## 1.8.0 - 8 March 2023
|
## [UNRELEASED]
|
||||||
|
|
||||||
|
## 1.8.0 - 9 March 2023
|
||||||
|
|
||||||
- Send telemetry about unhandled errors happening within the extension. [#2125](https://github.com/github/vscode-codeql/pull/2125)
|
- Send telemetry about unhandled errors happening within the extension. [#2125](https://github.com/github/vscode-codeql/pull/2125)
|
||||||
- Enable multi-repository variant analysis. [#2144](https://github.com/github/vscode-codeql/pull/2144)
|
- Enable multi-repository variant analysis. [#2144](https://github.com/github/vscode-codeql/pull/2144)
|
||||||
|
|||||||
@@ -93,12 +93,6 @@ export async function deployPackage(
|
|||||||
);
|
);
|
||||||
await copyPackage(sourcePath, distPath);
|
await copyPackage(sourcePath, distPath);
|
||||||
|
|
||||||
// This is necessary for vsce to know the dependencies
|
|
||||||
await copyDirectory(
|
|
||||||
resolve(sourcePath, "node_modules"),
|
|
||||||
resolve(distPath, "node_modules"),
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
distPath,
|
distPath,
|
||||||
name: packageJson.name,
|
name: packageJson.name,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export async function packageExtension(): Promise<void> {
|
|||||||
"..",
|
"..",
|
||||||
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
|
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
|
||||||
),
|
),
|
||||||
|
"--no-dependencies",
|
||||||
];
|
];
|
||||||
const proc = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
|
const proc = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
|
||||||
cwd: deployedPackage.distPath,
|
cwd: deployedPackage.distPath,
|
||||||
|
|||||||
4
extensions/ql-vscode/package-lock.json
generated
4
extensions/ql-vscode/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "vscode-codeql",
|
"name": "vscode-codeql",
|
||||||
"version": "1.8.0",
|
"version": "1.8.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vscode-codeql",
|
"name": "vscode-codeql",
|
||||||
"version": "1.8.0",
|
"version": "1.8.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"description": "CodeQL for Visual Studio Code",
|
"description": "CodeQL for Visual Studio Code",
|
||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.8.0",
|
"version": "1.8.1",
|
||||||
"publisher": "GitHub",
|
"publisher": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"icon": "media/VS-marketplace-CodeQL-icon.png",
|
"icon": "media/VS-marketplace-CodeQL-icon.png",
|
||||||
@@ -44,11 +44,6 @@
|
|||||||
"onView:test-explorer",
|
"onView:test-explorer",
|
||||||
"onCommand:codeQL.checkForUpdatesToCLI",
|
"onCommand:codeQL.checkForUpdatesToCLI",
|
||||||
"onCommand:codeQL.authenticateToGitHub",
|
"onCommand:codeQL.authenticateToGitHub",
|
||||||
"onCommand:codeQLDatabases.chooseDatabaseFolder",
|
|
||||||
"onCommand:codeQLDatabases.chooseDatabaseArchive",
|
|
||||||
"onCommand:codeQLDatabases.chooseDatabaseInternet",
|
|
||||||
"onCommand:codeQLDatabases.chooseDatabaseGithub",
|
|
||||||
"onCommand:codeQL.setCurrentDatabase",
|
|
||||||
"onCommand:codeQL.viewAst",
|
"onCommand:codeQL.viewAst",
|
||||||
"onCommand:codeQL.viewCfg",
|
"onCommand:codeQL.viewCfg",
|
||||||
"onCommand:codeQL.openReferencedFile",
|
"onCommand:codeQL.openReferencedFile",
|
||||||
@@ -57,16 +52,6 @@
|
|||||||
"onCommand:codeQL.chooseDatabaseArchive",
|
"onCommand:codeQL.chooseDatabaseArchive",
|
||||||
"onCommand:codeQL.chooseDatabaseInternet",
|
"onCommand:codeQL.chooseDatabaseInternet",
|
||||||
"onCommand:codeQL.chooseDatabaseGithub",
|
"onCommand:codeQL.chooseDatabaseGithub",
|
||||||
"onCommand:codeQLDatabases.chooseDatabase",
|
|
||||||
"onCommand:codeQLDatabases.setCurrentDatabase",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.openConfigFile",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.addNewDatabase",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.addNewList",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.setSelectedItem",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.setSelectedItemContextMenu",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.renameItemContextMenu",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.openOnGitHubContextMenu",
|
|
||||||
"onCommand:codeQLVariantAnalysisRepositories.removeItemContextMenu",
|
|
||||||
"onCommand:codeQL.quickQuery",
|
"onCommand:codeQL.quickQuery",
|
||||||
"onCommand:codeQL.restartQueryServer",
|
"onCommand:codeQL.restartQueryServer",
|
||||||
"onWebviewPanel:resultsView",
|
"onWebviewPanel:resultsView",
|
||||||
@@ -322,6 +307,10 @@
|
|||||||
"command": "codeQL.runVariantAnalysis",
|
"command": "codeQL.runVariantAnalysis",
|
||||||
"title": "CodeQL: Run Variant Analysis"
|
"title": "CodeQL: Run Variant Analysis"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.runVariantAnalysisContextEditor",
|
||||||
|
"title": "CodeQL: Run Variant Analysis"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.exportSelectedVariantAnalysisResults",
|
"command": "codeQL.exportSelectedVariantAnalysisResults",
|
||||||
"title": "CodeQL: Export Variant Analysis Results"
|
"title": "CodeQL: Export Variant Analysis Results"
|
||||||
@@ -334,10 +323,22 @@
|
|||||||
"command": "codeQL.quickEval",
|
"command": "codeQL.quickEval",
|
||||||
"title": "CodeQL: Quick Evaluation"
|
"title": "CodeQL: Quick Evaluation"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.quickEvalContextEditor",
|
||||||
|
"title": "CodeQL: Quick Evaluation"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.openReferencedFile",
|
"command": "codeQL.openReferencedFile",
|
||||||
"title": "CodeQL: Open Referenced File"
|
"title": "CodeQL: Open Referenced File"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.openReferencedFileContextEditor",
|
||||||
|
"title": "CodeQL: Open Referenced File"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.openReferencedFileContextExplorer",
|
||||||
|
"title": "CodeQL: Open Referenced File"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.previewQueryHelp",
|
"command": "codeQL.previewQueryHelp",
|
||||||
"title": "CodeQL: Preview Query Help"
|
"title": "CodeQL: Preview Query Help"
|
||||||
@@ -433,10 +434,26 @@
|
|||||||
"command": "codeQL.viewAst",
|
"command": "codeQL.viewAst",
|
||||||
"title": "CodeQL: View AST"
|
"title": "CodeQL: View AST"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewAstContextExplorer",
|
||||||
|
"title": "CodeQL: View AST"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewAstContextEditor",
|
||||||
|
"title": "CodeQL: View AST"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewCfg",
|
"command": "codeQL.viewCfg",
|
||||||
"title": "CodeQL: View CFG"
|
"title": "CodeQL: View CFG"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewCfgContextExplorer",
|
||||||
|
"title": "CodeQL: View CFG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewCfgContextEditor",
|
||||||
|
"title": "CodeQL: View CFG"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.upgradeCurrentDatabase",
|
"command": "codeQL.upgradeCurrentDatabase",
|
||||||
"title": "CodeQL: Upgrade Current Database"
|
"title": "CodeQL: Upgrade Current Database"
|
||||||
@@ -930,12 +947,12 @@
|
|||||||
"when": "resourceScheme == codeql-zip-archive || explorerResourceIsFolder || resourceExtname == .zip"
|
"when": "resourceScheme == codeql-zip-archive || explorerResourceIsFolder || resourceExtname == .zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewAst",
|
"command": "codeQL.viewAstContextExplorer",
|
||||||
"group": "9_qlCommands",
|
"group": "9_qlCommands",
|
||||||
"when": "resourceScheme == codeql-zip-archive && !explorerResourceIsFolder && !listMultiSelection"
|
"when": "resourceScheme == codeql-zip-archive && !explorerResourceIsFolder && !listMultiSelection"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewCfg",
|
"command": "codeQL.viewCfgContextExplorer",
|
||||||
"group": "9_qlCommands",
|
"group": "9_qlCommands",
|
||||||
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
||||||
},
|
},
|
||||||
@@ -945,7 +962,7 @@
|
|||||||
"when": "resourceScheme != codeql-zip-archive"
|
"when": "resourceScheme != codeql-zip-archive"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.openReferencedFile",
|
"command": "codeQL.openReferencedFileContextExplorer",
|
||||||
"group": "9_qlCommands",
|
"group": "9_qlCommands",
|
||||||
"when": "resourceExtname == .qlref"
|
"when": "resourceExtname == .qlref"
|
||||||
},
|
},
|
||||||
@@ -981,7 +998,8 @@
|
|||||||
"when": "editorLangId == ql && resourceExtname == .ql"
|
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.exportSelectedVariantAnalysisResults"
|
"command": "codeQL.runVariantAnalysisContextEditor",
|
||||||
|
"when": "false"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.runQueries",
|
"command": "codeQL.runQueries",
|
||||||
@@ -991,10 +1009,22 @@
|
|||||||
"command": "codeQL.quickEval",
|
"command": "codeQL.quickEval",
|
||||||
"when": "editorLangId == ql"
|
"when": "editorLangId == ql"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.quickEvalContextEditor",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.openReferencedFile",
|
"command": "codeQL.openReferencedFile",
|
||||||
"when": "resourceExtname == .qlref"
|
"when": "resourceExtname == .qlref"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.openReferencedFileContextEditor",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.openReferencedFileContextExplorer",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.previewQueryHelp",
|
"command": "codeQL.previewQueryHelp",
|
||||||
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
|
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
|
||||||
@@ -1007,10 +1037,26 @@
|
|||||||
"command": "codeQL.viewAst",
|
"command": "codeQL.viewAst",
|
||||||
"when": "resourceScheme == codeql-zip-archive"
|
"when": "resourceScheme == codeql-zip-archive"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewAstContextEditor",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewAstContextExplorer",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewCfg",
|
"command": "codeQL.viewCfg",
|
||||||
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewCfgContextExplorer",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "codeQL.viewCfgContextEditor",
|
||||||
|
"when": "false"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQLVariantAnalysisRepositories.openConfigFile",
|
"command": "codeQLVariantAnalysisRepositories.openConfigFile",
|
||||||
"when": "false"
|
"when": "false"
|
||||||
@@ -1234,23 +1280,23 @@
|
|||||||
"when": "editorLangId == ql && resourceExtname == .ql"
|
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.runVariantAnalysis",
|
"command": "codeQL.runVariantAnalysisContextEditor",
|
||||||
"when": "editorLangId == ql && resourceExtname == .ql"
|
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewAst",
|
"command": "codeQL.viewAstContextEditor",
|
||||||
"when": "resourceScheme == codeql-zip-archive"
|
"when": "resourceScheme == codeql-zip-archive"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewCfg",
|
"command": "codeQL.viewCfgContextEditor",
|
||||||
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.quickEval",
|
"command": "codeQL.quickEvalContextEditor",
|
||||||
"when": "editorLangId == ql"
|
"when": "editorLangId == ql"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.openReferencedFile",
|
"command": "codeQL.openReferencedFileContextEditor",
|
||||||
"when": "resourceExtname == .qlref"
|
"when": "resourceExtname == .qlref"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1074,6 +1074,7 @@ async function activateWithInstalledDistribution(
|
|||||||
queryServerLogger,
|
queryServerLogger,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunnerWithProgress(
|
commandRunnerWithProgress(
|
||||||
"codeQL.quickEval",
|
"codeQL.quickEval",
|
||||||
@@ -1091,6 +1092,24 @@ async function activateWithInstalledDistribution(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.quickEval" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.quickEvalContextEditor",
|
||||||
|
async (
|
||||||
|
progress: ProgressCallback,
|
||||||
|
token: CancellationToken,
|
||||||
|
uri: Uri | undefined,
|
||||||
|
) => await compileAndRunQuery(true, uri, progress, token, undefined),
|
||||||
|
{
|
||||||
|
title: "Running query",
|
||||||
|
cancellable: true,
|
||||||
|
},
|
||||||
|
// Open the query server logger on error since that's usually where the interesting errors appear.
|
||||||
|
queryServerLogger,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunnerWithProgress(
|
commandRunnerWithProgress(
|
||||||
"codeQL.codeLensQuickEval",
|
"codeQL.codeLensQuickEval",
|
||||||
@@ -1125,7 +1144,24 @@ async function activateWithInstalledDistribution(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// The "runVariantAnalysis" command is internal-only.
|
async function runVariantAnalysis(
|
||||||
|
progress: ProgressCallback,
|
||||||
|
token: CancellationToken,
|
||||||
|
uri: Uri | undefined,
|
||||||
|
): Promise<void> {
|
||||||
|
progress({
|
||||||
|
maxStep: 5,
|
||||||
|
step: 0,
|
||||||
|
message: "Getting credentials",
|
||||||
|
});
|
||||||
|
|
||||||
|
await variantAnalysisManager.runVariantAnalysis(
|
||||||
|
uri || window.activeTextEditor?.document.uri,
|
||||||
|
progress,
|
||||||
|
token,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunnerWithProgress(
|
commandRunnerWithProgress(
|
||||||
"codeQL.runVariantAnalysis",
|
"codeQL.runVariantAnalysis",
|
||||||
@@ -1133,19 +1169,23 @@ async function activateWithInstalledDistribution(
|
|||||||
progress: ProgressCallback,
|
progress: ProgressCallback,
|
||||||
token: CancellationToken,
|
token: CancellationToken,
|
||||||
uri: Uri | undefined,
|
uri: Uri | undefined,
|
||||||
) => {
|
) => await runVariantAnalysis(progress, token, uri),
|
||||||
progress({
|
{
|
||||||
maxStep: 5,
|
title: "Run Variant Analysis",
|
||||||
step: 0,
|
cancellable: true,
|
||||||
message: "Getting credentials",
|
|
||||||
});
|
|
||||||
|
|
||||||
await variantAnalysisManager.runVariantAnalysis(
|
|
||||||
uri || window.activeTextEditor?.document.uri,
|
|
||||||
progress,
|
|
||||||
token,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.runVariantAnalysis" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.runVariantAnalysisContextEditor",
|
||||||
|
async (
|
||||||
|
progress: ProgressCallback,
|
||||||
|
token: CancellationToken,
|
||||||
|
uri: Uri | undefined,
|
||||||
|
) => await runVariantAnalysis(progress, token, uri),
|
||||||
{
|
{
|
||||||
title: "Run Variant Analysis",
|
title: "Run Variant Analysis",
|
||||||
cancellable: true,
|
cancellable: true,
|
||||||
@@ -1290,6 +1330,19 @@ async function activateWithInstalledDistribution(
|
|||||||
commandRunner("codeQL.openReferencedFile", openReferencedFile),
|
commandRunner("codeQL.openReferencedFile", openReferencedFile),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.openReferencedFile" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunner("codeQL.openReferencedFileContextEditor", openReferencedFile),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.openReferencedFile" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunner(
|
||||||
|
"codeQL.openReferencedFileContextExplorer",
|
||||||
|
openReferencedFile,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunner("codeQL.previewQueryHelp", previewQueryHelp),
|
commandRunner("codeQL.previewQueryHelp", previewQueryHelp),
|
||||||
);
|
);
|
||||||
@@ -1474,6 +1527,22 @@ async function activateWithInstalledDistribution(
|
|||||||
const cfgTemplateProvider = new TemplatePrintCfgProvider(cliServer, dbm);
|
const cfgTemplateProvider = new TemplatePrintCfgProvider(cliServer, dbm);
|
||||||
|
|
||||||
ctx.subscriptions.push(astViewer);
|
ctx.subscriptions.push(astViewer);
|
||||||
|
|
||||||
|
async function viewAst(
|
||||||
|
progress: ProgressCallback,
|
||||||
|
token: CancellationToken,
|
||||||
|
selectedFile: Uri,
|
||||||
|
): Promise<void> {
|
||||||
|
const ast = await printAstTemplateProvider.provideAst(
|
||||||
|
progress,
|
||||||
|
token,
|
||||||
|
selectedFile ?? window.activeTextEditor?.document.uri,
|
||||||
|
);
|
||||||
|
if (ast) {
|
||||||
|
astViewer.updateRoots(await ast.getRoots(), ast.db, ast.fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunnerWithProgress(
|
commandRunnerWithProgress(
|
||||||
"codeQL.viewAst",
|
"codeQL.viewAst",
|
||||||
@@ -1481,16 +1550,39 @@ async function activateWithInstalledDistribution(
|
|||||||
progress: ProgressCallback,
|
progress: ProgressCallback,
|
||||||
token: CancellationToken,
|
token: CancellationToken,
|
||||||
selectedFile: Uri,
|
selectedFile: Uri,
|
||||||
) => {
|
) => await viewAst(progress, token, selectedFile),
|
||||||
const ast = await printAstTemplateProvider.provideAst(
|
{
|
||||||
progress,
|
cancellable: true,
|
||||||
token,
|
title: "Calculate AST",
|
||||||
selectedFile ?? window.activeTextEditor?.document.uri,
|
|
||||||
);
|
|
||||||
if (ast) {
|
|
||||||
astViewer.updateRoots(await ast.getRoots(), ast.db, ast.fileName);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.viewAst" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.viewAstContextExplorer",
|
||||||
|
async (
|
||||||
|
progress: ProgressCallback,
|
||||||
|
token: CancellationToken,
|
||||||
|
selectedFile: Uri,
|
||||||
|
) => await viewAst(progress, token, selectedFile),
|
||||||
|
{
|
||||||
|
cancellable: true,
|
||||||
|
title: "Calculate AST",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.viewAst" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.viewAstContextEditor",
|
||||||
|
async (
|
||||||
|
progress: ProgressCallback,
|
||||||
|
token: CancellationToken,
|
||||||
|
selectedFile: Uri,
|
||||||
|
) => await viewAst(progress, token, selectedFile),
|
||||||
{
|
{
|
||||||
cancellable: true,
|
cancellable: true,
|
||||||
title: "Calculate AST",
|
title: "Calculate AST",
|
||||||
@@ -1516,6 +1608,44 @@ async function activateWithInstalledDistribution(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.viewCfg" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.viewCfgContextExplorer",
|
||||||
|
async (progress: ProgressCallback, token: CancellationToken) => {
|
||||||
|
const res = await cfgTemplateProvider.provideCfgUri(
|
||||||
|
window.activeTextEditor?.document,
|
||||||
|
);
|
||||||
|
if (res) {
|
||||||
|
await compileAndRunQuery(false, res[0], progress, token, undefined);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Calculating Control Flow Graph",
|
||||||
|
cancellable: true,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Since we are tracking extension usage through commands, this command mirrors the "codeQL.viewCfg" command
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.viewCfgContextEditor",
|
||||||
|
async (progress: ProgressCallback, token: CancellationToken) => {
|
||||||
|
const res = await cfgTemplateProvider.provideCfgUri(
|
||||||
|
window.activeTextEditor?.document,
|
||||||
|
);
|
||||||
|
if (res) {
|
||||||
|
await compileAndRunQuery(false, res[0], progress, token, undefined);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Calculating Control Flow Graph",
|
||||||
|
cancellable: true,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const mockServer = new VSCodeMockGitHubApiServer(ctx);
|
const mockServer = new VSCodeMockGitHubApiServer(ctx);
|
||||||
ctx.subscriptions.push(mockServer);
|
ctx.subscriptions.push(mockServer);
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export class CommandManager {}
|
||||||
1
extensions/ql-vscode/src/packages/commands/index.ts
Normal file
1
extensions/ql-vscode/src/packages/commands/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from "./CommandManager";
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[
|
[
|
||||||
"v2.12.3",
|
"v2.12.4",
|
||||||
"v2.11.6",
|
"v2.11.6",
|
||||||
"v2.7.6",
|
"v2.7.6",
|
||||||
"v2.8.5",
|
"v2.8.5",
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { CommandManager } from "../../../../src/packages/commands";
|
||||||
|
|
||||||
|
describe(CommandManager.name, () => {
|
||||||
|
it("can create a command manager", () => {
|
||||||
|
const commandManager = new CommandManager();
|
||||||
|
expect(commandManager).not.toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -61,6 +61,7 @@ describe("Packaging commands", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await handleDownloadPacks(cli, progress);
|
await handleDownloadPacks(cli, progress);
|
||||||
|
expect(showAndLogExceptionWithTelemetrySpy).not.toHaveBeenCalled();
|
||||||
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
||||||
expect.stringContaining("Finished downloading packs."),
|
expect.stringContaining("Finished downloading packs."),
|
||||||
);
|
);
|
||||||
@@ -73,6 +74,7 @@ describe("Packaging commands", () => {
|
|||||||
inputBoxSpy.mockResolvedValue("codeql/csharp-solorigate-queries");
|
inputBoxSpy.mockResolvedValue("codeql/csharp-solorigate-queries");
|
||||||
|
|
||||||
await handleDownloadPacks(cli, progress);
|
await handleDownloadPacks(cli, progress);
|
||||||
|
expect(showAndLogExceptionWithTelemetrySpy).not.toHaveBeenCalled();
|
||||||
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
||||||
expect.stringContaining("Finished downloading packs."),
|
expect.stringContaining("Finished downloading packs."),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user