Skip to content

Commit e8f39fe

Browse files
author
Dave Bartolomeo
committed
Merge remote-tracking branch 'origin/main' into dbartol/debug-adapter
2 parents 1cbfd01 + b0940e6 commit e8f39fe

20 files changed

Lines changed: 1029 additions & 132 deletions

File tree

extensions/ql-vscode/.babelrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
"@babel/preset-typescript",
13+
"@babel/preset-react"
14+
],
15+
"plugins": []
16+
}

extensions/ql-vscode/.storybook/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const config: StorybookConfig = {
1212
core: {
1313
builder: "@storybook/builder-webpack5",
1414
},
15+
features: {
16+
babelModeV7: true,
17+
},
1518
};
1619

1720
module.exports = config;

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 bug that was causing code flows to not get updated when switching between results. [#2288](https://github.com/github/vscode-codeql/pull/2288)
56
- Restart the CodeQL language server whenever the _CodeQL: Restart Query Server_ command is invoked. This avoids bugs where the CLI version changes to support new language features, but the language server is not updated. [#2238](https://github.com/github/vscode-codeql/pull/2238)
67

78
## 1.8.1 - 23 March 2023

extensions/ql-vscode/src/contextual/queryResolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import { redactableError } from "../pure/errors";
2121
import { QLPACK_FILENAMES } from "../pure/ql";
2222

2323
export async function qlpackOfDatabase(
24-
cli: CodeQLCliServer,
25-
db: DatabaseItem,
24+
cli: Pick<CodeQLCliServer, "resolveQlpacks">,
25+
db: Pick<DatabaseItem, "contents">,
2626
): Promise<QlPacksForLanguage> {
2727
if (db.contents === undefined) {
2828
throw new Error("Database is invalid and cannot infer QLPack.");

extensions/ql-vscode/src/data-extensions-editor/data-extensions-editor-module.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import { ExtensionContext } from "vscode";
22
import { DataExtensionsEditorView } from "./data-extensions-editor-view";
33
import { DataExtensionsEditorCommands } from "../common/commands";
4-
import { CodeQLCliServer } from "../cli";
4+
import { CliVersionConstraint, CodeQLCliServer } from "../cli";
55
import { QueryRunner } from "../queryRunner";
66
import { DatabaseManager } from "../local-databases";
7-
import { extLogger } from "../common";
87
import { ensureDir } from "fs-extra";
98
import { join } from "path";
9+
import { App } from "../common/app";
10+
import { showAndLogErrorMessage } from "../helpers";
1011

1112
export class DataExtensionsEditorModule {
1213
private readonly queryStorageDir: string;
1314

1415
private constructor(
1516
private readonly ctx: ExtensionContext,
17+
private readonly app: App,
1618
private readonly databaseManager: DatabaseManager,
1719
private readonly cliServer: CodeQLCliServer,
1820
private readonly queryRunner: QueryRunner,
@@ -26,13 +28,15 @@ export class DataExtensionsEditorModule {
2628

2729
public static async initialize(
2830
ctx: ExtensionContext,
31+
app: App,
2932
databaseManager: DatabaseManager,
3033
cliServer: CodeQLCliServer,
3134
queryRunner: QueryRunner,
3235
queryStorageDir: string,
3336
): Promise<DataExtensionsEditorModule> {
3437
const dataExtensionsEditorModule = new DataExtensionsEditorModule(
3538
ctx,
39+
app,
3640
databaseManager,
3741
cliServer,
3842
queryRunner,
@@ -48,12 +52,21 @@ export class DataExtensionsEditorModule {
4852
"codeQL.openDataExtensionsEditor": async () => {
4953
const db = this.databaseManager.currentDatabaseItem;
5054
if (!db) {
51-
void extLogger.log("No database selected");
55+
void showAndLogErrorMessage("No database selected");
56+
return;
57+
}
58+
59+
if (!(await this.cliServer.cliConstraints.supportsQlpacksKind())) {
60+
void showAndLogErrorMessage(
61+
`This feature requires CodeQL CLI version ${CliVersionConstraint.CLI_VERSION_WITH_QLPACKS_KIND.format()} or later.`,
62+
);
5263
return;
5364
}
5465

5566
const view = new DataExtensionsEditorView(
5667
this.ctx,
68+
this.app,
69+
this.databaseManager,
5770
this.cliServer,
5871
this.queryRunner,
5972
this.queryStorageDir,

0 commit comments

Comments
 (0)