Merge pull request #3348 from github/koesie10/ruby-canary

Remove `enableRuby` feature flag
This commit is contained in:
Koen Vlaswinkel
2024-02-13 11:06:59 +01:00
committed by GitHub
3 changed files with 5 additions and 17 deletions

View File

@@ -716,7 +716,6 @@ const LLM_GENERATION_DEV_ENDPOINT = new Setting(
MODEL_SETTING,
);
const EXTENSIONS_DIRECTORY = new Setting("extensionsDirectory", MODEL_SETTING);
const ENABLE_RUBY = new Setting("enableRuby", MODEL_SETTING);
const ENABLE_ACCESS_PATH_SUGGESTIONS = new Setting(
"enableAccessPathSuggestions",
MODEL_SETTING,
@@ -726,7 +725,6 @@ export interface ModelConfig {
flowGeneration: boolean;
llmGeneration: boolean;
getExtensionsDirectory(languageId: string): string | undefined;
enableRuby: boolean;
enableAccessPathSuggestions: boolean;
}
@@ -765,10 +763,6 @@ export class ModelConfigListener extends ConfigListener implements ModelConfig {
});
}
public get enableRuby(): boolean {
return !!ENABLE_RUBY.getValue<boolean>();
}
public get enableAccessPathSuggestions(): boolean {
return !!ENABLE_ACCESS_PATH_SUGGESTIONS.getValue<boolean>();
}

View File

@@ -143,10 +143,7 @@ export class ModelEditorModule extends DisposableObject {
const language = db.language;
if (
!isQueryLanguage(language) ||
!isSupportedLanguage(language, this.modelConfig)
) {
if (!isQueryLanguage(language) || !isSupportedLanguage(language)) {
void showAndLogErrorMessage(
this.app.logger,
`The CodeQL Model Editor is not supported for ${language} databases.`,

View File

@@ -1,5 +1,5 @@
import { QueryLanguage } from "../common/query-language";
import type { ModelConfig } from "../config";
import { isCanary } from "../config";
/**
* Languages that are always supported by the model editor. These languages
@@ -10,17 +10,14 @@ export const SUPPORTED_LANGUAGES: QueryLanguage[] = [
QueryLanguage.CSharp,
];
export function isSupportedLanguage(
language: QueryLanguage,
modelConfig: ModelConfig,
) {
export function isSupportedLanguage(language: QueryLanguage) {
if (SUPPORTED_LANGUAGES.includes(language)) {
return true;
}
if (language === QueryLanguage.Ruby) {
// Ruby is only enabled when the config setting is set
return modelConfig.enableRuby;
// Ruby is only enabled when in canary mode
return isCanary();
}
return false;