Skip to content

Commit

Permalink
Merge pull request #2903 from github/robertbrignull/multiple-models-f…
Browse files Browse the repository at this point in the history
…eature-flag

Add feature flag for showing multiple modelings
  • Loading branch information
robertbrignull authored Oct 4, 2023
2 parents 55af9bc + e10e3ad commit 6d7fbfc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions extensions/ql-vscode/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ const MODEL_SETTING = new Setting("model", ROOT_SETTING);
const FLOW_GENERATION = new Setting("flowGeneration", MODEL_SETTING);
const LLM_GENERATION = new Setting("llmGeneration", MODEL_SETTING);
const EXTENSIONS_DIRECTORY = new Setting("extensionsDirectory", MODEL_SETTING);
const SHOW_MULTIPLE_MODELS = new Setting("showMultipleModels", MODEL_SETTING);

export function showFlowGeneration(): boolean {
return !!FLOW_GENERATION.getValue<boolean>();
Expand All @@ -723,3 +724,7 @@ export function getExtensionsDirectory(languageId: string): string | undefined {
languageId,
});
}

export function showMultipleModels(): boolean {
return !!SHOW_MULTIPLE_MODELS.getValue<boolean>();
}
7 changes: 6 additions & 1 deletion extensions/ql-vscode/src/model-editor/model-editor-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import {
import { Method, Usage } from "./method";
import { ModeledMethod } from "./modeled-method";
import { ExtensionPack } from "./shared/extension-pack";
import { showFlowGeneration, showLlmGeneration } from "../config";
import {
showFlowGeneration,
showLlmGeneration,
showMultipleModels,
} from "../config";
import { Mode } from "./shared/mode";
import { loadModeledMethods, saveModeledMethods } from "./modeled-method-fs";
import { pickExtensionPack } from "./extension-pack-picker";
Expand Down Expand Up @@ -365,6 +369,7 @@ export class ModelEditorView extends AbstractWebview<
extensionPack: this.extensionPack,
showFlowGeneration: showFlowGeneration(),
showLlmButton,
showMultipleModels: showMultipleModels(),
mode: this.mode,
},
});
Expand Down
1 change: 1 addition & 0 deletions extensions/ql-vscode/src/model-editor/shared/view-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export interface ModelEditorViewState {
extensionPack: ExtensionPack;
showFlowGeneration: boolean;
showLlmButton: boolean;
showMultipleModels: boolean;
mode: Mode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ LibraryRow.args = {
extensionPack: createMockExtensionPack(),
showFlowGeneration: true,
showLlmButton: true,
showMultipleModels: true,
mode: Mode.Application,
},
hideModeledMethods: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ModelEditor.args = {
},
showFlowGeneration: true,
showLlmButton: true,
showMultipleModels: true,
mode: Mode.Application,
},
initialMethods: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe(LibraryRow.name, () => {
mode: Mode.Application,
showFlowGeneration: false,
showLlmButton: false,
showMultipleModels: false,
extensionPack: createMockExtensionPack(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe(ModeledMethodsList.name, () => {
mode: Mode.Application,
showFlowGeneration: false,
showLlmButton: false,
showMultipleModels: false,
extensionPack: createMockExtensionPack(),
};

Expand Down

0 comments on commit 6d7fbfc

Please sign in to comment.