Skip to content

Commit

Permalink
Remove experimental features from extension and migrate old settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Nov 5, 2024
1 parent 6efa2d8 commit 940436f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
5 changes: 0 additions & 5 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions vscode/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
17 changes: 17 additions & 0 deletions vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export async function activate(context: vscode.ExtensionContext) {
return;
}

await migrateExperimentalFeaturesSetting();

const logger = await createLogger(context);
context.subscriptions.push(logger);

Expand All @@ -36,6 +38,21 @@ export async function deactivate(): Promise<void> {
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;

Expand Down

0 comments on commit 940436f

Please sign in to comment.