Skip to content

Commit 6561bb0

Browse files
Merge branch 'main' into robertbrignull/JumpToUsageMessage
2 parents 47509a9 + 319a54c commit 6561bb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+585
-233
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Increase the required version of VS Code to 1.82.0. [#2877](https://github.com/github/vscode-codeql/pull/2877)
88
- Fix a bug where the query server was restarted twice after configuration changes. [#2884](https://github.com/github/vscode-codeql/pull/2884).
99
- Add support for the `telemetry.telemetryLevel` setting. For more information, see the [telemetry documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code). [#2824](https://github.com/github/vscode-codeql/pull/2824).
10+
- Fix syntax highlighting directly after import statements with instantiation arguments. [#2792](https://github.com/github/vscode-codeql/pull/2792)
1011

1112
## 1.9.1 - 29 September 2023
1213

extensions/ql-vscode/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@
110110
"string"
111111
],
112112
"description": "Names of extension packs to include in the evaluation. These are resolved from the locations specified in `additionalPacks`."
113+
},
114+
"additionalRunQueryArgs": {
115+
"type": "object",
116+
"description": "**Internal use only**. Additional arguments to pass to the `runQuery` command of the query server, without validation."
113117
}
114118
}
115119
}

extensions/ql-vscode/src/common/interface-types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ interface GenerateMethodMessage {
555555
interface GenerateMethodsFromLlmMessage {
556556
t: "generateMethodsFromLlm";
557557
packageName: string;
558-
methods: Method[];
559-
modeledMethods: Record<string, ModeledMethod>;
558+
methodSignatures: string[];
560559
}
561560

562561
interface StopGeneratingMethodsFromLlmMessage {
@@ -633,7 +632,7 @@ interface SetMethodModelingPanelViewStateMessage {
633632

634633
interface SetMethodMessage {
635634
t: "setMethod";
636-
method: Method;
635+
method: Method | undefined;
637636
}
638637

639638
interface SetMethodModifiedMessage {

extensions/ql-vscode/src/debugger/debug-configuration.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface QLDebugArgs {
2222
extensionPacks?: string[] | string;
2323
quickEval?: boolean;
2424
noDebug?: boolean;
25+
additionalRunQueryArgs?: Record<string, any>;
2526
}
2627

2728
/**
@@ -120,6 +121,7 @@ export class QLDebugConfigurationProvider
120121
extensionPacks,
121122
quickEvalContext,
122123
noDebug: qlConfiguration.noDebug ?? false,
124+
additionalRunQueryArgs: qlConfiguration.additionalRunQueryArgs ?? {},
123125
};
124126

125127
return resultConfiguration;

extensions/ql-vscode/src/debugger/debug-protocol.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export interface LaunchConfig {
7070
quickEvalContext: QuickEvalContext | undefined;
7171
/** Run the query without debugging it. */
7272
noDebug: boolean;
73+
/** Undocumented: Additional arguments to be passed to the `runQuery` API on the query server. */
74+
additionalRunQueryArgs: Record<string, any>;
7375
}
7476

7577
export interface LaunchRequest extends Request, DebugProtocol.LaunchRequest {

extensions/ql-vscode/src/debugger/debug-session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class RunningQuery extends DisposableObject {
161161
true,
162162
config.additionalPacks,
163163
config.extensionPacks,
164+
config.additionalRunQueryArgs,
164165
queryStorageDir,
165166
undefined,
166167
undefined,

extensions/ql-vscode/src/language-support/contextual/query-resolver.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function runContextualQuery(
4444
false,
4545
getOnDiskWorkspaceFolders(),
4646
undefined,
47+
{},
4748
queryStorageDir,
4849
undefined,
4950
templates,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ export class LocalQueries extends DisposableObject {
456456
true,
457457
additionalPacks,
458458
extensionPacks,
459+
{},
459460
this.queryStorageDir,
460461
undefined,
461462
templates,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export async function runQuery({
4141
false,
4242
additionalPacks,
4343
extensionPacks,
44+
{},
4445
queryStorageDir,
4546
undefined,
4647
undefined,

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import { groupMethods, sortGroupNames, sortMethods } from "./shared/sorting";
1414
* the order in the UI.
1515
* @param mode Whether it is application or framework mode.
1616
* @param methods all methods.
17-
* @param modeledMethods the currently modeled methods.
17+
* @param modeledMethodsBySignature the currently modeled methods.
1818
* @returns list of modeled methods that are candidates for modeling.
1919
*/
2020
export function getCandidates(
2121
mode: Mode,
2222
methods: Method[],
23-
modeledMethods: Record<string, ModeledMethod>,
23+
modeledMethodsBySignature: Record<string, ModeledMethod[]>,
2424
): MethodSignature[] {
2525
// Sort the same way as the UI so we send the first ones listed in the UI first
2626
const grouped = groupMethods(methods, mode);
@@ -32,12 +32,11 @@ export function getCandidates(
3232
const candidates: MethodSignature[] = [];
3333

3434
for (const method of sortedMethods) {
35-
const modeledMethod: ModeledMethod = modeledMethods[method.signature] ?? {
36-
type: "none",
37-
};
35+
const modeledMethods: ModeledMethod[] =
36+
modeledMethodsBySignature[method.signature] ?? [];
3837

3938
// Anything that is modeled is not a candidate
40-
if (modeledMethod.type !== "none") {
39+
if (modeledMethods.some((m) => m.type !== "none")) {
4140
continue;
4241
}
4342

0 commit comments

Comments
 (0)