Skip to content

Commit 3346bd4

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/variant-analysis-remove-item-tests
2 parents 691121d + 5138831 commit 3346bd4

31 files changed

+1382
-415
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
cp dist/*.vsix artifacts
4848
4949
- name: Upload artifacts
50-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v3
5151
if: matrix.os == 'ubuntu-latest'
5252
with:
5353
name: vscode-codeql-extension

.vscode/settings.json

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,28 @@
4242
"LANG": "en-US",
4343
"TZ": "UTC"
4444
},
45-
// Uncomment to debug integration tests
46-
// "jestrunner.debugOptions": {
47-
// "attachSimplePort": 9223,
48-
// "env": {
49-
// "VSCODE_WAIT_FOR_DEBUGGER": "true",
50-
// }
51-
// },
45+
"jestrunner.debugOptions": {
46+
// Uncomment to debug integration tests
47+
// "attachSimplePort": 9223,
48+
"env": {
49+
"LANG": "en-US",
50+
"TZ": "UTC",
51+
// Uncomment to debug integration tests
52+
// "VSCODE_WAIT_FOR_DEBUGGER": "true",
53+
}
54+
},
55+
"terminal.integrated.env.linux": {
56+
"LANG": "en-US",
57+
"TZ": "UTC"
58+
},
59+
"terminal.integrated.env.osx": {
60+
"LANG": "en-US",
61+
"TZ": "UTC"
62+
},
63+
"terminal.integrated.env.windows": {
64+
"LANG": "en-US",
65+
"TZ": "UTC"
66+
},
5267
"[typescript]": {
5368
"editor.defaultFormatter": "esbenp.prettier-vscode",
5469
"editor.formatOnSave": true,

extensions/ql-vscode/package-lock.json

Lines changed: 130 additions & 0 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@
12861286
"watch:webpack": "gulp watchView",
12871287
"watch:files": "gulp watchTestData",
12881288
"test": "npm-run-all -p test:*",
1289-
"test:unit": "jest --projects test",
1289+
"test:unit": "cross-env TZ=UTC LANG=en-US jest --projects test",
12901290
"test:view": "jest --projects src/view",
12911291
"integration": "npm-run-all integration:*",
12921292
"integration:no-workspace": "jest --projects src/vscode-tests/no-workspace",
@@ -1397,6 +1397,7 @@
13971397
"ansi-colors": "^4.1.1",
13981398
"applicationinsights": "^2.3.5",
13991399
"babel-loader": "^8.2.5",
1400+
"cross-env": "^7.0.3",
14001401
"css-loader": "~3.1.0",
14011402
"del": "^6.0.0",
14021403
"eslint": "^8.23.1",

extensions/ql-vscode/patches/jest-runner-vscode+3.0.1.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
diff --git a/node_modules/jest-runner-vscode/dist/child/environment.js b/node_modules/jest-runner-vscode/dist/child/environment.js
2+
index 1ac28d5..f91f216 100644
3+
--- a/node_modules/jest-runner-vscode/dist/child/environment.js
4+
+++ b/node_modules/jest-runner-vscode/dist/child/environment.js
5+
@@ -10,6 +10,21 @@ const wrap_io_1 = __importDefault(require("./wrap-io"));
6+
const load_pnp_1 = __importDefault(require("./load-pnp"));
7+
const ipc = new ipc_client_1.default('env');
8+
class VSCodeEnvironment extends jest_environment_node_1.default {
9+
+ constructor(config, context) {
10+
+ super(config, context);
11+
+ // The _VSCODE_NODE_MODULES is a proxy which will require a module if any property
12+
+ // on it is accessed. This is a workaround for the fact that jest will call
13+
+ // _isMockFunction on the module, which will cause that function to be required.
14+
+ this.global._VSCODE_NODE_MODULES = new Proxy(this.global._VSCODE_NODE_MODULES, {
15+
+ get(target, prop) {
16+
+ if (prop === '_isMockFunction') {
17+
+ return undefined;
18+
+ }
19+
+ return target[prop];
20+
+ },
21+
+ });
22+
+ }
23+
+
24+
async setup() {
25+
await super.setup();
26+
await (0, load_pnp_1.default)();
127
diff --git a/node_modules/jest-runner-vscode/dist/child/runner.js b/node_modules/jest-runner-vscode/dist/child/runner.js
228
index 0663c5c..4991663 100644
329
--- a/node_modules/jest-runner-vscode/dist/child/runner.js

extensions/ql-vscode/src/databases/config/db-config-store.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { pathExists, writeJSON, readJSON, readJSONSync } from "fs-extra";
22
import { join } from "path";
3-
import { cloneDbConfig, DbConfig, SelectedDbItem } from "./db-config";
3+
import {
4+
cloneDbConfig,
5+
DbConfig,
6+
ExpandedDbItem,
7+
SelectedDbItem,
8+
} from "./db-config";
49
import * as chokidar from "chokidar";
510
import { DisposableObject, DisposeHandler } from "../../pure/disposable-object";
611
import { DbConfigValidator } from "./db-config-validator";
@@ -72,6 +77,19 @@ export class DbConfigStore extends DisposableObject {
7277
await this.writeConfig(config);
7378
}
7479

80+
public async updateExpandedState(expandedItems: ExpandedDbItem[]) {
81+
if (!this.config) {
82+
throw Error("Cannot update expansion state if config is not loaded");
83+
}
84+
85+
const config: DbConfig = {
86+
...this.config,
87+
expanded: expandedItems,
88+
};
89+
90+
await this.writeConfig(config);
91+
}
92+
7593
private async writeConfig(config: DbConfig): Promise<void> {
7694
await writeJSON(this.configPath, config, {
7795
spaces: 2,
@@ -137,6 +155,7 @@ export class DbConfigStore extends DisposableObject {
137155
databases: [],
138156
},
139157
},
158+
expanded: [],
140159
};
141160
}
142161
}

extensions/ql-vscode/src/databases/config/db-config.ts

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

33
export interface DbConfig {
44
databases: DbConfigDatabases;
5+
expanded: ExpandedDbItem[];
56
selected?: SelectedDbItem;
67
}
78

@@ -87,6 +88,37 @@ export interface LocalDatabase {
8788
storagePath: string;
8889
}
8990

91+
export type ExpandedDbItem =
92+
| RootLocalExpandedDbItem
93+
| LocalUserDefinedListExpandedDbItem
94+
| RootRemoteExpandedDbItem
95+
| RemoteUserDefinedListExpandedDbItem;
96+
97+
export enum ExpandedDbItemKind {
98+
RootLocal = "rootLocal",
99+
LocalUserDefinedList = "localUserDefinedList",
100+
RootRemote = "rootRemote",
101+
RemoteUserDefinedList = "remoteUserDefinedList",
102+
}
103+
104+
export interface RootLocalExpandedDbItem {
105+
kind: ExpandedDbItemKind.RootLocal;
106+
}
107+
108+
export interface LocalUserDefinedListExpandedDbItem {
109+
kind: ExpandedDbItemKind.LocalUserDefinedList;
110+
listName: string;
111+
}
112+
113+
export interface RootRemoteExpandedDbItem {
114+
kind: ExpandedDbItemKind.RootRemote;
115+
}
116+
117+
export interface RemoteUserDefinedListExpandedDbItem {
118+
kind: ExpandedDbItemKind.RemoteUserDefinedList;
119+
listName: string;
120+
}
121+
90122
export function cloneDbConfig(config: DbConfig): DbConfig {
91123
return {
92124
databases: {
@@ -108,6 +140,7 @@ export function cloneDbConfig(config: DbConfig): DbConfig {
108140
databases: config.databases.local.databases.map((db) => ({ ...db })),
109141
},
110142
},
143+
expanded: config.expanded.map(cloneDbConfigExpandedItem),
111144
selected: config.selected
112145
? cloneDbConfigSelectedItem(config.selected)
113146
: undefined,
@@ -150,3 +183,17 @@ function cloneDbConfigSelectedItem(selected: SelectedDbItem): SelectedDbItem {
150183
};
151184
}
152185
}
186+
187+
function cloneDbConfigExpandedItem(item: ExpandedDbItem): ExpandedDbItem {
188+
switch (item.kind) {
189+
case ExpandedDbItemKind.RootLocal:
190+
case ExpandedDbItemKind.RootRemote:
191+
return { kind: item.kind };
192+
case ExpandedDbItemKind.LocalUserDefinedList:
193+
case ExpandedDbItemKind.RemoteUserDefinedList:
194+
return {
195+
kind: item.kind,
196+
listName: item.listName,
197+
};
198+
}
199+
}

0 commit comments

Comments
 (0)