Merge pull request #3676 from github/koesie10/remove-python-ff

Remove feature flag for Python model editor
This commit is contained in:
Koen Vlaswinkel
2024-08-01 11:43:24 +02:00
committed by GitHub
3 changed files with 3 additions and 12 deletions

View File

@@ -2,6 +2,7 @@
## [UNRELEASED] ## [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) - 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 ## 1.13.1 - 29 May 2024

View File

@@ -840,7 +840,6 @@ const LLM_GENERATION_DEV_ENDPOINT = new Setting(
const MODEL_EVALUATION = new Setting("evaluation", MODEL_SETTING); const MODEL_EVALUATION = new Setting("evaluation", MODEL_SETTING);
const MODEL_PACK_LOCATION = new Setting("packLocation", MODEL_SETTING); const MODEL_PACK_LOCATION = new Setting("packLocation", MODEL_SETTING);
const MODEL_PACK_NAME = new Setting("packName", MODEL_SETTING); const MODEL_PACK_NAME = new Setting("packName", MODEL_SETTING);
const ENABLE_PYTHON = new Setting("enablePython", MODEL_SETTING);
export type ModelConfigPackVariables = { export type ModelConfigPackVariables = {
database: string; database: string;
@@ -857,7 +856,6 @@ export interface ModelConfig {
variables: ModelConfigPackVariables, variables: ModelConfigPackVariables,
): string; ): string;
getPackName(languageId: string, variables: ModelConfigPackVariables): string; getPackName(languageId: string, variables: ModelConfigPackVariables): string;
enablePython: boolean;
} }
export class ModelConfigListener extends ConfigListener implements ModelConfig { export class ModelConfigListener extends ConfigListener implements ModelConfig {
@@ -919,10 +917,6 @@ export class ModelConfigListener extends ConfigListener implements ModelConfig {
variables, variables,
); );
} }
public get enablePython(): boolean {
return !!ENABLE_PYTHON.getValue<boolean>();
}
} }
const GITHUB_DATABASE_SETTING = new Setting("githubDatabase", ROOT_SETTING); const GITHUB_DATABASE_SETTING = new Setting("githubDatabase", ROOT_SETTING);

View File

@@ -9,20 +9,16 @@ export const SUPPORTED_LANGUAGES: QueryLanguage[] = [
QueryLanguage.Java, QueryLanguage.Java,
QueryLanguage.CSharp, QueryLanguage.CSharp,
QueryLanguage.Ruby, QueryLanguage.Ruby,
QueryLanguage.Python,
]; ];
export function isSupportedLanguage( export function isSupportedLanguage(
language: QueryLanguage, language: QueryLanguage,
modelConfig: ModelConfig, _modelConfig: ModelConfig,
) { ) {
if (SUPPORTED_LANGUAGES.includes(language)) { if (SUPPORTED_LANGUAGES.includes(language)) {
return true; return true;
} }
if (language === QueryLanguage.Python) {
// Python is only enabled when the config setting is set
return modelConfig.enablePython;
}
return false; return false;
} }