From 940436f35f13cac1542a888c1619723f24e98767 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Tue, 5 Nov 2024 15:53:51 -0500 Subject: [PATCH] Remove experimental features from extension and migrate old settings --- vscode/package.json | 5 ----- vscode/src/client.ts | 3 --- vscode/src/extension.ts | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/vscode/package.json b/vscode/package.json index a43474426..5900eb13d 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -158,11 +158,6 @@ "configuration": { "title": "Ruby LSP", "properties": { - "rubyLsp.enableExperimentalFeatures": { - "description": "Enable experimental and under development features", - "type": "boolean", - "default": false - }, "rubyLsp.enabledFeatures": { "description": "List of enabled LSP features", "type": "object", diff --git a/vscode/src/client.ts b/vscode/src/client.ts index 49263d415..7d097c87b 100644 --- a/vscode/src/client.ts +++ b/vscode/src/client.ts @@ -218,9 +218,6 @@ function collectClientOptions( errorHandler: new ClientErrorHandler(workspaceFolder, telemetry), initializationOptions: { enabledFeatures, - experimentalFeaturesEnabled: configuration.get( - "enableExperimentalFeatures", - ), featuresConfiguration: configuration.get("featuresConfiguration"), formatter: configuration.get("formatter"), linters: configuration.get("linters"), diff --git a/vscode/src/extension.ts b/vscode/src/extension.ts index 82595e7f5..842cf4fe3 100644 --- a/vscode/src/extension.ts +++ b/vscode/src/extension.ts @@ -25,6 +25,8 @@ export async function activate(context: vscode.ExtensionContext) { return; } + await migrateExperimentalFeaturesSetting(); + const logger = await createLogger(context); context.subscriptions.push(logger); @@ -36,6 +38,21 @@ export async function deactivate(): Promise { await extension.deactivate(); } +// Remove after ~2 months. This code migrates the old experimental features setting to the new feature flag rollout +// setting +async function migrateExperimentalFeaturesSetting() { + const config = vscode.workspace.getConfiguration("rubyLsp"); + const experimentalFeatures = config.get("enableExperimentalFeatures"); + + if (experimentalFeatures) { + // Remove the old setting + await config.update("enableExperimentalFeatures", undefined, true); + + // Add the new one + await config.update("featureFlags", { all: true }, true); + } +} + async function createLogger(context: vscode.ExtensionContext) { let sender;