Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove feature flag for Python model editor #3676

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [UNRELEASED]

- Add Python support to the CodeQL Model Editor. [#3676](https://github.com/github/vscode-codeql/pull/3676)
- Update variant analysis view to display the length of the shortest path for path queries. [#3671](https://github.com/github/vscode-codeql/pull/3671)

## 1.13.1 - 29 May 2024
Expand Down
6 changes: 0 additions & 6 deletions extensions/ql-vscode/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,6 @@ const LLM_GENERATION_DEV_ENDPOINT = new Setting(
const MODEL_EVALUATION = new Setting("evaluation", MODEL_SETTING);
const MODEL_PACK_LOCATION = new Setting("packLocation", MODEL_SETTING);
const MODEL_PACK_NAME = new Setting("packName", MODEL_SETTING);
const ENABLE_PYTHON = new Setting("enablePython", MODEL_SETTING);

export type ModelConfigPackVariables = {
database: string;
Expand All @@ -857,7 +856,6 @@ export interface ModelConfig {
variables: ModelConfigPackVariables,
): string;
getPackName(languageId: string, variables: ModelConfigPackVariables): string;
enablePython: boolean;
}

export class ModelConfigListener extends ConfigListener implements ModelConfig {
Expand Down Expand Up @@ -919,10 +917,6 @@ export class ModelConfigListener extends ConfigListener implements ModelConfig {
variables,
);
}

public get enablePython(): boolean {
return !!ENABLE_PYTHON.getValue<boolean>();
}
}

const GITHUB_DATABASE_SETTING = new Setting("githubDatabase", ROOT_SETTING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@ export const SUPPORTED_LANGUAGES: QueryLanguage[] = [
QueryLanguage.Java,
QueryLanguage.CSharp,
QueryLanguage.Ruby,
QueryLanguage.Python,
];

export function isSupportedLanguage(
language: QueryLanguage,
modelConfig: ModelConfig,
_modelConfig: ModelConfig,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left this parameter here for now since it's likely we'll be adding new languages at some point in the future with a feature flag.

) {
if (SUPPORTED_LANGUAGES.includes(language)) {
return true;
}

if (language === QueryLanguage.Python) {
// Python is only enabled when the config setting is set
return modelConfig.enablePython;
}

return false;
}
Loading