Skip to content

Commit

Permalink
Merge branch 'main' into shati-patel/db-src-archive
Browse files Browse the repository at this point in the history
  • Loading branch information
shati-patel authored Nov 6, 2023
2 parents b6583b0 + 1c19d7a commit 2294d8c
Show file tree
Hide file tree
Showing 63 changed files with 1,263 additions and 966 deletions.
4 changes: 4 additions & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- 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.
- To restore the old behavior of adding all database source folders by default, set the `codeQL.addingDatabases.addDatabaseSourceToWorkspace` setting to `true`.

## 1.9.4 - 6 November 2023

No user facing changes.

## 1.9.3 - 26 October 2023

- 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)
Expand Down
4 changes: 2 additions & 2 deletions extensions/ql-vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "CodeQL for Visual Studio Code",
"author": "GitHub",
"private": true,
"version": "1.9.4",
"version": "1.9.5",
"publisher": "GitHub",
"license": "MIT",
"icon": "media/VS-marketplace-CodeQL-icon.png",
Expand Down
6 changes: 6 additions & 0 deletions extensions/ql-vscode/src/common/mutable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Remove all readonly modifiers from a type.
*/
export type Mutable<T> = {
-readonly [P in keyof T]: T[P];
};
1 change: 1 addition & 0 deletions extensions/ql-vscode/src/local-queries/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./local-queries";
export * from "./local-query-run";
export * from "./query-constraints";
export * from "./query-resolver";
export * from "./quick-eval-code-lens-provider";
export * from "./quick-query";
Expand Down
7 changes: 7 additions & 0 deletions extensions/ql-vscode/src/local-queries/query-constraints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface QueryConstraints {
kind?: string;
"tags contain"?: string[];
"tags contain all"?: string[];
"query filename"?: string;
"query path"?: string;
}
9 changes: 1 addition & 8 deletions extensions/ql-vscode/src/local-queries/query-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { showAndLogExceptionWithTelemetry } from "../common/logging";
import { extLogger } from "../common/logging/vscode";
import { telemetryListener } from "../common/vscode/telemetry";
import { SuiteInstruction } from "../packaging/suite-instruction";
import { QueryConstraints } from "./query-constraints";

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

export interface QueryConstraints {
kind?: string;
"tags contain"?: string[];
"tags contain all"?: string[];
"query filename"?: string;
"query path"?: string;
}

/**
* Finds the queries with the specified kind and tags in a list of CodeQL packs.
*
Expand Down
21 changes: 14 additions & 7 deletions extensions/ql-vscode/src/log-insights/join-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ function makeKey(
const DEPENDENT_PREDICATES_REGEXP = (() => {
const regexps = [
// SCAN id
String.raw`SCAN\s+([0-9a-zA-Z:#_]+)\s`,
String.raw`SCAN\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s`,
// JOIN id WITH id
String.raw`JOIN\s+([0-9a-zA-Z:#_]+)\s+WITH\s+([0-9a-zA-Z:#_]+)\s`,
String.raw`JOIN\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s+WITH\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s`,
// AGGREGATE id, id
String.raw`AGGREGATE\s+([0-9a-zA-Z:#_]+)\s*,\s+([0-9a-zA-Z:#_]+)`,
String.raw`AGGREGATE\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s*,\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)`,
// id AND NOT id
String.raw`([0-9a-zA-Z:#_]+)\s+AND\s+NOT\s+([0-9a-zA-Z:#_]+)`,
String.raw`([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s+AND\s+NOT\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)`,
// INVOKE HIGHER-ORDER RELATION rel ON <id, ..., id>
String.raw`INVOKE\s+HIGHER-ORDER\s+RELATION\s[^\s]+\sON\s+<([0-9a-zA-Z:#_<>]+)((?:,[0-9a-zA-Z:#_<>]+)*)>`,
String.raw`INVOKE\s+HIGHER-ORDER\s+RELATION\s[^\s]+\sON\s+<([0-9a-zA-Z:#_<>]+|\`[^\`\r\n]*\`)((?:,[0-9a-zA-Z:#_<>]+|,\`[^\`\r\n]*\`)*)>`,
// SELECT id
String.raw`SELECT\s+([0-9a-zA-Z:#_]+)`,
String.raw`SELECT\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)`,
// REWRITE id WITH
String.raw`REWRITE\s+([0-9a-zA-Z:#_]+|\`[^\`\r\n]*\`)\s+WITH\s`,
];
return new RegExp(
`${String.raw`\{[0-9]+\}\s+[0-9a-zA-Z]+\s=\s(?:` + regexps.join("|")})`,
Expand All @@ -65,7 +67,12 @@ function getDependentPredicates(operations: string[]): I.List<string> {
.rest() // Skip the first group as it's just the entire string
.filter((x) => !!x && !x.match("r[0-9]+|PRIMITIVE")) // Only keep the references to predicates.
.flatMap((x) => x.split(",")) // Group 2 in the INVOKE HIGHER_ORDER RELATION case is a comma-separated list of identifiers.
.filter((x) => !!x); // Remove empty strings
.filter((x) => !!x) // Remove empty strings
.map((x) =>
x.startsWith("`") && x.endsWith("`")
? x.substring(1, x.length - 1)
: x,
); // Remove quotes from quoted identifiers
} else {
return I.List();
}
Expand Down
23 changes: 0 additions & 23 deletions extensions/ql-vscode/src/model-editor/auto-modeler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,29 +208,6 @@ export class AutoModeler {
return;
}

// Any candidate that was part of the response is a negative result
// meaning that the canidate is not a sink for the kinds that the LLM is checking for.
// For now we model this as a sink neutral method, however this is subject
// to discussion.
for (const candidate of candidateMethods) {
if (!(candidate.signature in loadedMethods)) {
loadedMethods[candidate.signature] = [
{
type: "neutral",
kind: "sink",
input: "",
output: "",
provenance: "ai-generated",
signature: candidate.signature,
packageName: candidate.packageName,
typeName: candidate.typeName,
methodName: candidate.methodName,
methodParameters: candidate.methodParameters,
},
];
}
}

await this.addModeledMethods(loadedMethods);
}

Expand Down
194 changes: 0 additions & 194 deletions extensions/ql-vscode/src/model-editor/flow-model-queries.ts

This file was deleted.

Loading

0 comments on commit 2294d8c

Please sign in to comment.