From f56a2a079069edafd74ef92b7e545f18be88b243 Mon Sep 17 00:00:00 2001 From: oxalica Date: Sat, 14 Dec 2019 00:48:47 +0800 Subject: Enable `allFeatures` by default and fix lints --- editors/code/package.json | 2 +- editors/code/src/config.ts | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 8ed95fda7..e3bb07be7 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -286,7 +286,7 @@ }, "rust-analyzer.cargoFeatures.allFeatures": { "type": "boolean", - "default": false, + "default": true, "description": "Activate all available features" }, "rust-analyzer.cargoFeatures.features": { diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 6d709f7a8..defdfeb9c 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -43,7 +43,7 @@ export class Config { }; public cargoFeatures: CargoFeatures = { noDefaultFeatures: false, - allFeatures: false, + allFeatures: true, features: [], }; @@ -88,7 +88,8 @@ export class Config { } if (this.prevEnhancedTyping !== this.enableEnhancedTyping) { - requireReloadMessage = 'Changing enhanced typing setting requires a reload'; + requireReloadMessage = + 'Changing enhanced typing setting requires a reload'; this.prevEnhancedTyping = this.enableEnhancedTyping; } @@ -165,7 +166,7 @@ export class Config { if (config.has('cargoFeatures.allFeatures')) { this.cargoFeatures.allFeatures = config.get( 'cargoFeatures.allFeatures', - false, + true, ); } if (config.has('cargoFeatures.features')) { @@ -175,12 +176,18 @@ export class Config { ); } - if (this.prevCargoFeatures !== null && ( - this.cargoFeatures.allFeatures !== this.prevCargoFeatures.allFeatures || - this.cargoFeatures.noDefaultFeatures !== this.prevCargoFeatures.noDefaultFeatures || - this.cargoFeatures.features.length !== this.prevCargoFeatures.features.length || - this.cargoFeatures.features.some((v, i) => v !== this.prevCargoFeatures!.features[i]) - )) { + if ( + this.prevCargoFeatures !== null && + (this.cargoFeatures.allFeatures !== + this.prevCargoFeatures.allFeatures || + this.cargoFeatures.noDefaultFeatures !== + this.prevCargoFeatures.noDefaultFeatures || + this.cargoFeatures.features.length !== + this.prevCargoFeatures.features.length || + this.cargoFeatures.features.some( + (v, i) => v !== this.prevCargoFeatures!.features[i], + )) + ) { requireReloadMessage = 'Changing cargo features requires a reload'; } this.prevCargoFeatures = { ...this.cargoFeatures }; -- cgit v1.2.3