Skip to content

Commit 2294d8c

Browse files
authored
Merge branch 'main' into shati-patel/db-src-archive
2 parents b6583b0 + 1c19d7a commit 2294d8c

63 files changed

Lines changed: 1263 additions & 966 deletions

File tree

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/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
- You can manually add individual database source folders to the workspace with the "Add Database Source to Workspace" right-click command in the databases view.
77
- To restore the old behavior of adding all database source folders by default, set the `codeQL.addingDatabases.addDatabaseSourceToWorkspace` setting to `true`.
88

9+
## 1.9.4 - 6 November 2023
10+
11+
No user facing changes.
12+
913
## 1.9.3 - 26 October 2023
1014

1115
- Sorted result set filenames now include a hash of the result set name instead of the full name. [#2955](https://github.com/github/vscode-codeql/pull/2955)

extensions/ql-vscode/package-lock.json

Lines changed: 2 additions & 2 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "CodeQL for Visual Studio Code",
55
"author": "GitHub",
66
"private": true,
7-
"version": "1.9.4",
7+
"version": "1.9.5",
88
"publisher": "GitHub",
99
"license": "MIT",
1010
"icon": "media/VS-marketplace-CodeQL-icon.png",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Remove all readonly modifiers from a type.
3+
*/
4+
export type Mutable<T> = {
5+
-readonly [P in keyof T]: T[P];
6+
};

extensions/ql-vscode/src/local-queries/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from "./local-queries";
22
export * from "./local-query-run";
3+
export * from "./query-constraints";
34
export * from "./query-resolver";
45
export * from "./quick-eval-code-lens-provider";
56
export * from "./quick-query";
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface QueryConstraints {
2+
kind?: string;
3+
"tags contain"?: string[];
4+
"tags contain all"?: string[];
5+
"query filename"?: string;
6+
"query path"?: string;
7+
}

extensions/ql-vscode/src/local-queries/query-resolver.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { showAndLogExceptionWithTelemetry } from "../common/logging";
1414
import { extLogger } from "../common/logging/vscode";
1515
import { telemetryListener } from "../common/vscode/telemetry";
1616
import { SuiteInstruction } from "../packaging/suite-instruction";
17+
import { QueryConstraints } from "./query-constraints";
1718

1819
export async function qlpackOfDatabase(
1920
cli: Pick<CodeQLCliServer, "resolveQlpacks">,
@@ -27,14 +28,6 @@ export async function qlpackOfDatabase(
2728
return await getQlPackForDbscheme(cli, dbscheme);
2829
}
2930

30-
export interface QueryConstraints {
31-
kind?: string;
32-
"tags contain"?: string[];
33-
"tags contain all"?: string[];
34-
"query filename"?: string;
35-
"query path"?: string;
36-
}
37-
3831
/**
3932
* Finds the queries with the specified kind and tags in a list of CodeQL packs.
4033
*

extensions/ql-vscode/src/log-insights/join-order.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,19 @@ function makeKey(
4040
const DEPENDENT_PREDICATES_REGEXP = (() => {
4141
const regexps = [
4242
// SCAN id
43-
String.raw`SCAN\s+([0-9a-zA-Z:#_]+)\s`,
43+
String.raw`SCAN\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s`,
4444
// JOIN id WITH id
45-
String.raw`JOIN\s+([0-9a-zA-Z:#_]+)\s+WITH\s+([0-9a-zA-Z:#_]+)\s`,
45+
String.raw`JOIN\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s+WITH\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s`,
4646
// AGGREGATE id, id
47-
String.raw`AGGREGATE\s+([0-9a-zA-Z:#_]+)\s*,\s+([0-9a-zA-Z:#_]+)`,
47+
String.raw`AGGREGATE\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s*,\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)`,
4848
// id AND NOT id
49-
String.raw`([0-9a-zA-Z:#_]+)\s+AND\s+NOT\s+([0-9a-zA-Z:#_]+)`,
49+
String.raw`([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s+AND\s+NOT\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)`,
5050
// INVOKE HIGHER-ORDER RELATION rel ON <id, ..., id>
51-
String.raw`INVOKE\s+HIGHER-ORDER\s+RELATION\s[^\s]+\sON\s+<([0-9a-zA-Z:#_<>]+)((?:,[0-9a-zA-Z:#_<>]+)*)>`,
51+
String.raw`INVOKE\s+HIGHER-ORDER\s+RELATION\s[^\s]+\sON\s+<([0-9a-zA-Z:#_<>]+|\`[^\`\r\n]*\`)((?:,[0-9a-zA-Z:#_<>]+|,\`[^\`\r\n]*\`)*)>`,
5252
// SELECT id
53-
String.raw`SELECT\s+([0-9a-zA-Z:#_]+)`,
53+
String.raw`SELECT\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)`,
54+
// REWRITE id WITH
55+
String.raw`REWRITE\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s+WITH\s`,
5456
];
5557
return new RegExp(
5658
`${String.raw`\{[0-9]+\}\s+[0-9a-zA-Z]+\s=\s(?:` + regexps.join("|")})`,
@@ -65,7 +67,12 @@ function getDependentPredicates(operations: string[]): I.List<string> {
6567
.rest() // Skip the first group as it's just the entire string
6668
.filter((x) => !!x && !x.match("r[0-9]+|PRIMITIVE")) // Only keep the references to predicates.
6769
.flatMap((x) => x.split(",")) // Group 2 in the INVOKE HIGHER_ORDER RELATION case is a comma-separated list of identifiers.
68-
.filter((x) => !!x); // Remove empty strings
70+
.filter((x) => !!x) // Remove empty strings
71+
.map((x) =>
72+
x.startsWith("`") && x.endsWith("`")
73+
? x.substring(1, x.length - 1)
74+
: x,
75+
); // Remove quotes from quoted identifiers
6976
} else {
7077
return I.List();
7178
}

extensions/ql-vscode/src/model-editor/auto-modeler.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -208,29 +208,6 @@ export class AutoModeler {
208208
return;
209209
}
210210

211-
// Any candidate that was part of the response is a negative result
212-
// meaning that the canidate is not a sink for the kinds that the LLM is checking for.
213-
// For now we model this as a sink neutral method, however this is subject
214-
// to discussion.
215-
for (const candidate of candidateMethods) {
216-
if (!(candidate.signature in loadedMethods)) {
217-
loadedMethods[candidate.signature] = [
218-
{
219-
type: "neutral",
220-
kind: "sink",
221-
input: "",
222-
output: "",
223-
provenance: "ai-generated",
224-
signature: candidate.signature,
225-
packageName: candidate.packageName,
226-
typeName: candidate.typeName,
227-
methodName: candidate.methodName,
228-
methodParameters: candidate.methodParameters,
229-
},
230-
];
231-
}
232-
}
233-
234211
await this.addModeledMethods(loadedMethods);
235212
}
236213

extensions/ql-vscode/src/model-editor/flow-model-queries.ts

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)