Skip to content

Commit d27efb3

Browse files
author
Dave Bartolomeo
committed
Merge remote-tracking branch 'origin/main' into dbartol/save-before-start
2 parents 8ff1db1 + 67d342f commit d27efb3

54 files changed

Lines changed: 2011 additions & 1463 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extensions/ql-vscode/.eslintrc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ const baseConfig = {
6565
"import/no-namespace": "off",
6666
"import/no-unresolved": "off",
6767
"import/no-webpack-loader-syntax": "off",
68-
"jsx-a11y/anchor-is-valid": "off",
69-
"jsx-a11y/no-noninteractive-element-interactions": "off",
70-
"jsx-a11y/no-static-element-interactions": "off",
71-
"jsx-a11y/click-events-have-key-events": "off",
7268
"no-invalid-this": "off",
7369
"no-fallthrough": "off",
7470
"no-console": "off",

extensions/ql-vscode/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [UNRELEASED]
44

5+
- Add `CodeQL: Quick Evaluation Count` command to generate the count summary statistics of the results set
6+
without speding the time to compute locations and strings.
7+
58
## 1.8.6 - 14 June 2023
69

710
- Add repositories to a variant analysis list with GitHub Code Search. [#2439](https://github.com/github/vscode-codeql/pull/2439) and [#2476](https://github.com/github/vscode-codeql/pull/2476)

extensions/ql-vscode/package-lock.json

Lines changed: 7 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@
457457
"command": "codeQL.quickEval",
458458
"title": "CodeQL: Quick Evaluation"
459459
},
460+
{
461+
"command": "codeQL.quickEvalCount",
462+
"title": "CodeQL: Quick Evaluation Count"
463+
},
460464
{
461465
"command": "codeQL.quickEvalContextEditor",
462466
"title": "CodeQL: Quick Evaluation"
@@ -501,6 +505,33 @@
501505
"command": "codeQL.copyVersion",
502506
"title": "CodeQL: Copy Version Information"
503507
},
508+
{
509+
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
510+
"title": "Run local query",
511+
"icon": "$(run)"
512+
},
513+
{
514+
"command": "codeQLQueries.runLocalQueriesFromPanel",
515+
"title": "Run local queries",
516+
"icon": "$(run-all)"
517+
},
518+
{
519+
"command": "codeQL.runLocalQueryFromFileTab",
520+
"title": "CodeQL: Run local query",
521+
"icon": "$(run)"
522+
},
523+
{
524+
"command": "codeQLQueries.runLocalQueryContextMenu",
525+
"title": "Run against local database"
526+
},
527+
{
528+
"command": "codeQLQueries.runLocalQueriesContextMenu",
529+
"title": "Run against local database"
530+
},
531+
{
532+
"command": "codeQLQueries.runVariantAnalysisContextMenu",
533+
"title": "Run against variant analysis repositories"
534+
},
504535
{
505536
"command": "codeQLVariantAnalysisRepositories.openConfigFile",
506537
"title": "Open database configuration file",
@@ -872,6 +903,13 @@
872903
}
873904
],
874905
"menus": {
906+
"editor/title": [
907+
{
908+
"command": "codeQL.runLocalQueryFromFileTab",
909+
"group": "navigation",
910+
"when": "resourceExtname == .ql && codeQL.currentDatabaseItem"
911+
}
912+
],
875913
"view/title": [
876914
{
877915
"command": "codeQLDatabases.sortByName",
@@ -1095,6 +1133,31 @@
10951133
"group": "1_queryHistory@1",
10961134
"when": "viewItem == remoteResultsItem"
10971135
},
1136+
{
1137+
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
1138+
"group": "inline",
1139+
"when": "view == codeQLQueries && viewItem == queryFile && codeQL.currentDatabaseItem"
1140+
},
1141+
{
1142+
"command": "codeQLQueries.runLocalQueryContextMenu",
1143+
"group": "queriesPanel@1",
1144+
"when": "view == codeQLQueries && viewItem == queryFile && codeQL.currentDatabaseItem"
1145+
},
1146+
{
1147+
"command": "codeQLQueries.runLocalQueriesContextMenu",
1148+
"group": "queriesPanel@1",
1149+
"when": "view == codeQLQueries && viewItem == queryFolder && codeQL.currentDatabaseItem"
1150+
},
1151+
{
1152+
"command": "codeQLQueries.runVariantAnalysisContextMenu",
1153+
"group": "queriesPanel@1",
1154+
"when": "view == codeQLQueries && viewItem == queryFile"
1155+
},
1156+
{
1157+
"command": "codeQLQueries.runLocalQueriesFromPanel",
1158+
"group": "inline",
1159+
"when": "view == codeQLQueries && viewItem == queryFolder && codeQL.currentDatabaseItem"
1160+
},
10981161
{
10991162
"command": "codeQLTests.showOutputDifferences",
11001163
"group": "qltest@1",
@@ -1154,6 +1217,18 @@
11541217
"command": "codeQL.runQuery",
11551218
"when": "resourceLangId == ql && resourceExtname == .ql"
11561219
},
1220+
{
1221+
"command": "codeQLQueries.runLocalQueryFromQueriesPanel",
1222+
"when": "false"
1223+
},
1224+
{
1225+
"command": "codeQLQueries.runLocalQueriesFromPanel",
1226+
"when": "false"
1227+
},
1228+
{
1229+
"command": "codeQL.runLocalQueryFromFileTab",
1230+
"when": "false"
1231+
},
11571232
{
11581233
"command": "codeQL.runQueryContextEditor",
11591234
"when": "false"
@@ -1206,6 +1281,10 @@
12061281
"command": "codeQL.quickEval",
12071282
"when": "editorLangId == ql"
12081283
},
1284+
{
1285+
"command": "codeQL.quickEvalCount",
1286+
"when": "editorLangId == ql && codeql.supportsQuickEvalCount"
1287+
},
12091288
{
12101289
"command": "codeQL.quickEvalContextEditor",
12111290
"when": "false"
@@ -1274,6 +1353,18 @@
12741353
"command": "codeQL.openDataExtensionsEditor",
12751354
"when": "config.codeQL.canary && config.codeQL.dataExtensions.editor"
12761355
},
1356+
{
1357+
"command": "codeQLQueries.runLocalQueryContextMenu",
1358+
"when": "false"
1359+
},
1360+
{
1361+
"command": "codeQLQueries.runLocalQueriesContextMenu",
1362+
"when": "false"
1363+
},
1364+
{
1365+
"command": "codeQLQueries.runVariantAnalysisContextMenu",
1366+
"when": "false"
1367+
},
12771368
{
12781369
"command": "codeQLVariantAnalysisRepositories.openConfigFile",
12791370
"when": "false"
@@ -1673,7 +1764,7 @@
16731764
"path-browserify": "^1.0.1",
16741765
"react": "^18.2.0",
16751766
"react-dom": "^18.2.0",
1676-
"semver": "~7.3.2",
1767+
"semver": "~7.5.2",
16771768
"source-map": "^0.7.4",
16781769
"source-map-support": "^0.5.21",
16791770
"stream": "^0.0.2",

extensions/ql-vscode/src/codeql-cli/cli.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,13 @@ export class CodeQLCliServer implements Disposable {
14831483
CliVersionConstraint.CLI_VERSION_WITH_PER_QUERY_EVAL_LOG,
14841484
) >= 0,
14851485
);
1486+
await this.app.commands.execute(
1487+
"setContext",
1488+
"codeql.supportsQuickEvalCount",
1489+
newVersion.compare(
1490+
CliVersionConstraint.CLI_VERSION_WITH_QUICK_EVAL_COUNT,
1491+
) >= 0,
1492+
);
14861493
} catch (e) {
14871494
this._versionChangedListeners.forEach((listener) =>
14881495
listener(undefined),
@@ -1845,6 +1852,18 @@ export class CliVersionConstraint {
18451852

18461853
public static CLI_VERSION_GLOBAL_CACHE = new SemVer("2.12.4");
18471854

1855+
/**
1856+
* CLI version where the query server supports quick-eval count mode.
1857+
*/
1858+
public static CLI_VERSION_WITH_QUICK_EVAL_COUNT = new SemVer("2.13.3");
1859+
1860+
/**
1861+
* CLI version where the langauge server supports visisbility change notifications.
1862+
*/
1863+
public static CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS = new SemVer(
1864+
"2.14.0",
1865+
);
1866+
18481867
constructor(private readonly cli: CodeQLCliServer) {
18491868
/**/
18501869
}
@@ -1918,4 +1937,16 @@ export class CliVersionConstraint {
19181937
async usesGlobalCompilationCache() {
19191938
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_GLOBAL_CACHE);
19201939
}
1940+
1941+
async supportsVisibilityNotifications() {
1942+
return this.isVersionAtLeast(
1943+
CliVersionConstraint.CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS,
1944+
);
1945+
}
1946+
1947+
async supportsQuickEvalCount() {
1948+
return this.isVersionAtLeast(
1949+
CliVersionConstraint.CLI_VERSION_WITH_QUICK_EVAL_COUNT,
1950+
);
1951+
}
19211952
}

extensions/ql-vscode/src/common/commands.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
VariantAnalysisScannedRepositoryResult,
1313
} from "../variant-analysis/shared/variant-analysis";
1414
import type { QLDebugConfiguration } from "../debugger/debug-configuration";
15+
import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item";
1516

1617
// A command function matching the signature that VS Code calls when
1718
// a command is invoked from a context menu on a TreeView with
@@ -129,8 +130,14 @@ export type LocalQueryCommands = {
129130
"codeQL.runQueryOnMultipleDatabasesContextEditor": (
130131
uri?: Uri,
131132
) => Promise<void>;
133+
"codeQLQueries.runLocalQueryFromQueriesPanel": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
134+
"codeQLQueries.runLocalQueryContextMenu": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
135+
"codeQLQueries.runLocalQueriesContextMenu": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
136+
"codeQLQueries.runLocalQueriesFromPanel": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
137+
"codeQL.runLocalQueryFromFileTab": (uri: Uri) => Promise<void>;
132138
"codeQL.runQueries": ExplorerSelectionCommandFunction<Uri>;
133139
"codeQL.quickEval": (uri: Uri) => Promise<void>;
140+
"codeQL.quickEvalCount": (uri: Uri) => Promise<void>;
134141
"codeQL.quickEvalContextEditor": (uri: Uri) => Promise<void>;
135142
"codeQL.codeLensQuickEval": (uri: Uri, range: Range) => Promise<void>;
136143
"codeQL.quickQuery": () => Promise<void>;
@@ -262,6 +269,7 @@ export type VariantAnalysisCommands = {
262269
) => Promise<void>;
263270
"codeQL.runVariantAnalysis": (uri?: Uri) => Promise<void>;
264271
"codeQL.runVariantAnalysisContextEditor": (uri?: Uri) => Promise<void>;
272+
"codeQLQueries.runVariantAnalysisContextMenu": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
265273
};
266274

267275
export type DatabasePanelCommands = {

0 commit comments

Comments
 (0)