Skip to content

Commit 9884476

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/query-language
2 parents 87be402 + 12615f1 commit 9884476

File tree

111 files changed

+4049
-1408
lines changed

Some content is hidden

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

111 files changed

+4049
-1408
lines changed
Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
11
/**
22
* @name Unwanted dependency on vscode API
3-
* @kind problem
3+
* @kind path-problem
44
* @problem.severity error
55
* @id vscode-codeql/assert-pure
66
* @description The modules stored under `pure` and tested in the `pure-tests`
77
* are intended to be "pure".
88
*/
9+
910
import javascript
1011

11-
class VSCodeImport extends ASTNode {
12-
VSCodeImport() {
13-
this.(Import).getImportedPath().getValue() = "vscode"
12+
class VSCodeImport extends ImportDeclaration {
13+
VSCodeImport() { this.getImportedPath().getValue() = "vscode" }
14+
}
15+
16+
class PureFile extends File {
17+
PureFile() {
18+
(
19+
this.getRelativePath().regexpMatch(".*/src/pure/.*") or
20+
this.getRelativePath().regexpMatch(".*/src/common/.*")
21+
) and
22+
not this.getRelativePath().regexpMatch(".*/vscode/.*")
1423
}
1524
}
1625

26+
Import getANonTypeOnlyImport(Module m) {
27+
result = m.getAnImport() and not result.(ImportDeclaration).isTypeOnly()
28+
}
29+
30+
query predicate edges(AstNode a, AstNode b) {
31+
getANonTypeOnlyImport(a) = b or
32+
a.(Import).getImportedModule() = b
33+
}
34+
1735
from Module m, VSCodeImport v
1836
where
19-
m.getFile().getRelativePath().regexpMatch(".*src/pure/.*") and
20-
m.getAnImportedModule*().getAnImport() = v
21-
select m, "This module is not pure: it has a transitive dependency on the vscode API imported $@", v, "here"
37+
m.getFile() instanceof PureFile and
38+
edges+(m, v)
39+
select m, m, v,
40+
"This module is not pure: it has a transitive dependency on the vscode API imported $@", v, "here"

extensions/ql-vscode/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
## [UNRELEASED]
44

55
- Add settings `codeQL.variantAnalysis.defaultResultsFilter` and `codeQL.variantAnalysis.defaultResultsSort` for configuring how variant analysis results are filtered and sorted in the results view. The default is to show all repositories, and to sort by the number of results. [#2392](https://github.com/github/vscode-codeql/pull/2392)
6+
- Fix bug to ensure error messages have complete stack trace in message logs. [#2425](https://github.com/github/vscode-codeql/pull/2425)
7+
- Fix bug where the `CodeQL: Compare Query` command did not work for comparing quick-eval queries. [#2422](https://github.com/github/vscode-codeql/pull/2422)
8+
- Update text of copy and export buttons in variant analysis results view to clarify that they only copy/export the selected/filtered results. [#2427](https://github.com/github/vscode-codeql/pull/2427)
9+
- Add warning when using unsupported CodeQL CLI version. [#2428](https://github.com/github/vscode-codeql/pull/2428)
610

711
## 1.8.4 - 3 May 2023
812

extensions/ql-vscode/package.json

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"activationEvents": [
3737
"onLanguage:ql",
3838
"onLanguage:ql-summary",
39+
"onView:codeQLQueries",
3940
"onView:codeQLDatabases",
4041
"onView:codeQLVariantAnalysisRepositories",
4142
"onView:codeQLQueryHistory",
@@ -476,6 +477,14 @@
476477
"command": "codeQL.previewQueryHelp",
477478
"title": "CodeQL: Preview Query Help"
478479
},
480+
{
481+
"command": "codeQL.previewQueryHelpContextExplorer",
482+
"title": "CodeQL: Preview Query Help"
483+
},
484+
{
485+
"command": "codeQL.previewQueryHelpContextEditor",
486+
"title": "CodeQL: Preview Query Help"
487+
},
479488
{
480489
"command": "codeQL.quickQuery",
481490
"title": "CodeQL: Quick Query"
@@ -507,6 +516,10 @@
507516
"title": "Add new list",
508517
"icon": "$(new-folder)"
509518
},
519+
{
520+
"command": "codeQLVariantAnalysisRepositories.importFromCodeSearch",
521+
"title": "Add repositories with GitHub Code Search"
522+
},
510523
{
511524
"command": "codeQLVariantAnalysisRepositories.setSelectedItem",
512525
"title": "Select"
@@ -828,6 +841,11 @@
828841
"title": "CodeQL: Go to QL Code",
829842
"enablement": "codeql.hasQLSource"
830843
},
844+
{
845+
"command": "codeQL.gotoQLContextEditor",
846+
"title": "CodeQL: Go to QL Code",
847+
"enablement": "codeql.hasQLSource"
848+
},
831849
{
832850
"command": "codeQL.openDataExtensionsEditor",
833851
"title": "CodeQL: Open Data Extensions Editor"
@@ -947,6 +965,11 @@
947965
"when": "view == codeQLVariantAnalysisRepositories && viewItem =~ /canBeOpenedOnGitHub/",
948966
"group": "2_qlContextMenu@1"
949967
},
968+
{
969+
"command": "codeQLVariantAnalysisRepositories.importFromCodeSearch",
970+
"when": "view == codeQLVariantAnalysisRepositories && viewItem =~ /canImportCodeSearch/",
971+
"group": "2_qlContextMenu@1"
972+
},
950973
{
951974
"command": "codeQLDatabases.setCurrentDatabase",
952975
"group": "inline",
@@ -1117,7 +1140,7 @@
11171140
"when": "resourceExtname == .qlref"
11181141
},
11191142
{
1120-
"command": "codeQL.previewQueryHelp",
1143+
"command": "codeQL.previewQueryHelpContextExplorer",
11211144
"group": "9_qlCommands",
11221145
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
11231146
}
@@ -1203,6 +1226,14 @@
12031226
"command": "codeQL.previewQueryHelp",
12041227
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
12051228
},
1229+
{
1230+
"command": "codeQL.previewQueryHelpContextEditor",
1231+
"when": "false"
1232+
},
1233+
{
1234+
"command": "codeQL.previewQueryHelpContextExplorer",
1235+
"when": "false"
1236+
},
12061237
{
12071238
"command": "codeQL.setCurrentDatabase",
12081239
"when": "false"
@@ -1275,6 +1306,10 @@
12751306
"command": "codeQLVariantAnalysisRepositories.removeItemContextMenu",
12761307
"when": "false"
12771308
},
1309+
{
1310+
"command": "codeQLVariantAnalysisRepositories.importFromCodeSearch",
1311+
"when": "false"
1312+
},
12781313
{
12791314
"command": "codeQLDatabases.setCurrentDatabase",
12801315
"when": "false"
@@ -1466,6 +1501,10 @@
14661501
{
14671502
"command": "codeQLTests.acceptOutputContextTestItem",
14681503
"when": "false"
1504+
},
1505+
{
1506+
"command": "codeQL.gotoQLContextEditor",
1507+
"when": "false"
14691508
}
14701509
],
14711510
"editor/context": [
@@ -1510,11 +1549,11 @@
15101549
"when": "resourceExtname == .qlref"
15111550
},
15121551
{
1513-
"command": "codeQL.previewQueryHelp",
1552+
"command": "codeQL.previewQueryHelpContextEditor",
15141553
"when": "resourceExtname == .qhelp && isWorkspaceTrusted"
15151554
},
15161555
{
1517-
"command": "codeQL.gotoQL",
1556+
"command": "codeQL.gotoQLContextEditor",
15181557
"when": "editorLangId == ql-summary && config.codeQL.canary"
15191558
}
15201559
]
@@ -1530,6 +1569,11 @@
15301569
},
15311570
"views": {
15321571
"ql-container": [
1572+
{
1573+
"id": "codeQLQueries",
1574+
"name": "Queries",
1575+
"when": "config.codeQL.canary && config.codeQL.queriesPanel"
1576+
},
15331577
{
15341578
"id": "codeQLDatabases",
15351579
"name": "Databases"
@@ -1562,6 +1606,10 @@
15621606
"view": "codeQLQueryHistory",
15631607
"contents": "You have no query history items at the moment.\n\nSelect a database to run a CodeQL query and get your first results."
15641608
},
1609+
{
1610+
"view": "codeQLQueries",
1611+
"contents": "This workspace doesn't contain any CodeQL queries at the moment."
1612+
},
15651613
{
15661614
"view": "codeQLDatabases",
15671615
"contents": "Add a CodeQL database:\n[From a folder](command:codeQLDatabases.chooseDatabaseFolder)\n[From an archive](command:codeQLDatabases.chooseDatabaseArchive)\n[From a URL (as a zip file)](command:codeQLDatabases.chooseDatabaseInternet)\n[From GitHub](command:codeQLDatabases.chooseDatabaseGithub)"

0 commit comments

Comments
 (0)