Skip to content

Commit 7af0c32

Browse files
authored
Merge branch 'main' into qlref-better-access
2 parents a7c20c0 + 31dc11e commit 7af0c32

7 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
strategy:
152152
matrix:
153153
os: [ubuntu-latest, windows-latest]
154-
version: ['v2.3.3', 'v2.4.6', 'v2.5.9', 'v2.6.3', 'nightly']
154+
version: ['v2.3.3', 'v2.4.6', 'v2.5.9', 'v2.6.3', 'v2.7.0', 'nightly']
155155
env:
156156
CLI_VERSION: ${{ matrix.version }}
157157
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
44
// List of extensions which should be recommended for users of this workspace.
55
"recommendations": [
6-
"eamodio.tsl-problem-matcher",
6+
"amodio.tsl-problem-matcher",
77
"dbaeumer.vscode-eslint",
88
"eternalphane.tsfmt-vscode"
99
],

.vscode/launch.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
// change to 'true' debug the IDE or Query servers
2222
"IDE_SERVER_JAVA_DEBUG": "false",
2323
"QUERY_SERVER_JAVA_DEBUG": "false",
24+
"CLI_SERVER_JAVA_DEBUG": "false",
25+
// Uncomment to set the JAVA_HOME for the codeql instance to use
26+
// "CODEQL_JAVA_HOME": "/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home"
2427
}
2528
},
2629
{

extensions/ql-vscode/CHANGELOG.md

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

33
## [UNRELEASED]
44

5+
- Fix the _CodeQL: Open Referenced File_ command for Windows systems. [#979](https://github.com/github/vscode-codeql/pull/979)
56
- Fix a bug that shows 'Set current database' when hovering over the currently selected database in the databases view. [#976](https://github.com/github/vscode-codeql/pull/976)
67
- Fix a bug with importing large databases. Databases over 4GB can now be imported directly from LGTM or from a zip file. This functionality is only available when using CodeQL CLI version 2.6.0 or later. [#971](https://github.com/github/vscode-codeql/pull/971)
78
- Replace certain control codes (`U+0000` - `U+001F`) with their corresponding control labels (`U+2400` - `U+241F`) in the results view. [#963](https://github.com/github/vscode-codeql/pull/963)

extensions/ql-vscode/src/cli.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,16 @@ export class CodeQLCliServer implements Disposable {
257257
*/
258258
private async launchProcess(): Promise<child_process.ChildProcessWithoutNullStreams> {
259259
const codeQlPath = await this.getCodeQlPath();
260+
const args = [];
261+
if (shouldDebugCliServer()) {
262+
args.push('-J=-agentlib:jdwp=transport=dt_socket,address=localhost:9012,server=n,suspend=y,quiet=y');
263+
}
264+
260265
return await spawnServer(
261266
codeQlPath,
262267
'CodeQL CLI Server',
263268
['execute', 'cli-server'],
264-
[],
269+
args,
265270
this.logger,
266271
_data => { /**/ }
267272
);
@@ -605,7 +610,7 @@ export class CodeQLCliServer implements Disposable {
605610
if (target) subcommandArgs.push('--target', target);
606611
if (name) subcommandArgs.push('--name', name);
607612
subcommandArgs.push(archivePath);
608-
613+
609614
return await this.runCodeQlCliCommand(['database', 'unbundle'], subcommandArgs, `Extracting ${archivePath} to directory ${target}`);
610615
}
611616

@@ -1049,6 +1054,12 @@ export function shouldDebugQueryServer() {
10491054
&& process.env.QUERY_SERVER_JAVA_DEBUG?.toLocaleLowerCase() !== 'false';
10501055
}
10511056

1057+
export function shouldDebugCliServer() {
1058+
return 'CLI_SERVER_JAVA_DEBUG' in process.env
1059+
&& process.env.CLI_SERVER_JAVA_DEBUG !== '0'
1060+
&& process.env.CLI_SERVER_JAVA_DEBUG?.toLocaleLowerCase() !== 'false';
1061+
}
1062+
10521063
export class CliVersionConstraint {
10531064

10541065
/**

extensions/ql-vscode/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ async function activateWithInstalledDistribution(
497497
selectedQuery: Uri
498498
): Promise<void> {
499499
// If no file is selected, the path of the file in the editor is selected
500-
const path = selectedQuery?.path || window.activeTextEditor?.document.uri.fsPath;
500+
const path = selectedQuery?.fsPath || window.activeTextEditor?.document.uri.fsPath;
501501
if (qs !== undefined && path) {
502502
if (await cliServer.cliConstraints.supportsResolveQlref()) {
503503
const resolved = await cliServer.resolveQlref(path);

extensions/ql-vscode/src/vscode-tests/ensureCli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const _10MB = _1MB * 10;
4444

4545
// CLI version to test. Hard code the latest as default. And be sure
4646
// to update the env if it is not otherwise set.
47-
const CLI_VERSION = process.env.CLI_VERSION || 'v2.6.3';
47+
const CLI_VERSION = process.env.CLI_VERSION || 'v2.7.0';
4848
process.env.CLI_VERSION = CLI_VERSION;
4949

5050
// Base dir where CLIs will be downloaded into

0 commit comments

Comments
 (0)