Skip to content

Commit 461cf15

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/convert-remaining-multiple-models
2 parents 54e1b29 + 623890a commit 461cf15

File tree

51 files changed

+1170
-328
lines changed

Some content is hidden

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

51 files changed

+1170
-328
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/* @github/codeql-vscode-reviewers
22
**/variant-analysis/ @github/code-scanning-secexp-reviewers
33
**/databases/ @github/code-scanning-secexp-reviewers
4+
**/method-modeling/ @github/code-scanning-secexp-reviewers
45
**/model-editor/ @github/code-scanning-secexp-reviewers
56
**/queries-panel/ @github/code-scanning-secexp-reviewers

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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,7 @@ interface RefreshMethods {
546546

547547
interface SaveModeledMethods {
548548
t: "saveModeledMethods";
549-
methods: Method[];
550-
modeledMethods: Record<string, ModeledMethod>;
549+
methodSignatures?: string[];
551550
}
552551

553552
interface GenerateMethodMessage {

extensions/ql-vscode/src/config.ts

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -705,20 +705,33 @@ const LLM_GENERATION = new Setting("llmGeneration", MODEL_SETTING);
705705
const EXTENSIONS_DIRECTORY = new Setting("extensionsDirectory", MODEL_SETTING);
706706
const SHOW_MULTIPLE_MODELS = new Setting("showMultipleModels", MODEL_SETTING);
707707

708-
export function showFlowGeneration(): boolean {
709-
return !!FLOW_GENERATION.getValue<boolean>();
708+
export interface ModelConfig {
709+
flowGeneration: boolean;
710+
llmGeneration: boolean;
711+
getExtensionsDirectory(languageId: string): string | undefined;
712+
showMultipleModels: boolean;
710713
}
711714

712-
export function showLlmGeneration(): boolean {
713-
return !!LLM_GENERATION.getValue<boolean>();
714-
}
715+
export class ModelConfigListener extends ConfigListener implements ModelConfig {
716+
protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void {
717+
this.handleDidChangeConfigurationForRelevantSettings([MODEL_SETTING], e);
718+
}
715719

716-
export function getExtensionsDirectory(languageId: string): string | undefined {
717-
return EXTENSIONS_DIRECTORY.getValue<string>({
718-
languageId,
719-
});
720-
}
720+
public get flowGeneration(): boolean {
721+
return !!FLOW_GENERATION.getValue<boolean>();
722+
}
721723

722-
export function showMultipleModels(): boolean {
723-
return !!SHOW_MULTIPLE_MODELS.getValue<boolean>();
724+
public get llmGeneration(): boolean {
725+
return !!LLM_GENERATION.getValue<boolean>();
726+
}
727+
728+
public getExtensionsDirectory(languageId: string): string | undefined {
729+
return EXTENSIONS_DIRECTORY.getValue<string>({
730+
languageId,
731+
});
732+
}
733+
734+
public get showMultipleModels(): boolean {
735+
return !!SHOW_MULTIPLE_MODELS.getValue<boolean>();
736+
}
724737
}

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,

0 commit comments

Comments
 (0)