diff options
-rw-r--r-- | editors/code/package.json | 2 | ||||
-rw-r--r-- | editors/code/src/config.ts | 25 |
2 files changed, 17 insertions, 10 deletions
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 @@ | |||
286 | }, | 286 | }, |
287 | "rust-analyzer.cargoFeatures.allFeatures": { | 287 | "rust-analyzer.cargoFeatures.allFeatures": { |
288 | "type": "boolean", | 288 | "type": "boolean", |
289 | "default": false, | 289 | "default": true, |
290 | "description": "Activate all available features" | 290 | "description": "Activate all available features" |
291 | }, | 291 | }, |
292 | "rust-analyzer.cargoFeatures.features": { | 292 | "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 { | |||
43 | }; | 43 | }; |
44 | public cargoFeatures: CargoFeatures = { | 44 | public cargoFeatures: CargoFeatures = { |
45 | noDefaultFeatures: false, | 45 | noDefaultFeatures: false, |
46 | allFeatures: false, | 46 | allFeatures: true, |
47 | features: [], | 47 | features: [], |
48 | }; | 48 | }; |
49 | 49 | ||
@@ -88,7 +88,8 @@ export class Config { | |||
88 | } | 88 | } |
89 | 89 | ||
90 | if (this.prevEnhancedTyping !== this.enableEnhancedTyping) { | 90 | if (this.prevEnhancedTyping !== this.enableEnhancedTyping) { |
91 | requireReloadMessage = 'Changing enhanced typing setting requires a reload'; | 91 | requireReloadMessage = |
92 | 'Changing enhanced typing setting requires a reload'; | ||
92 | this.prevEnhancedTyping = this.enableEnhancedTyping; | 93 | this.prevEnhancedTyping = this.enableEnhancedTyping; |
93 | } | 94 | } |
94 | 95 | ||
@@ -165,7 +166,7 @@ export class Config { | |||
165 | if (config.has('cargoFeatures.allFeatures')) { | 166 | if (config.has('cargoFeatures.allFeatures')) { |
166 | this.cargoFeatures.allFeatures = config.get( | 167 | this.cargoFeatures.allFeatures = config.get( |
167 | 'cargoFeatures.allFeatures', | 168 | 'cargoFeatures.allFeatures', |
168 | false, | 169 | true, |
169 | ); | 170 | ); |
170 | } | 171 | } |
171 | if (config.has('cargoFeatures.features')) { | 172 | if (config.has('cargoFeatures.features')) { |
@@ -175,12 +176,18 @@ export class Config { | |||
175 | ); | 176 | ); |
176 | } | 177 | } |
177 | 178 | ||
178 | if (this.prevCargoFeatures !== null && ( | 179 | if ( |
179 | this.cargoFeatures.allFeatures !== this.prevCargoFeatures.allFeatures || | 180 | this.prevCargoFeatures !== null && |
180 | this.cargoFeatures.noDefaultFeatures !== this.prevCargoFeatures.noDefaultFeatures || | 181 | (this.cargoFeatures.allFeatures !== |
181 | this.cargoFeatures.features.length !== this.prevCargoFeatures.features.length || | 182 | this.prevCargoFeatures.allFeatures || |
182 | this.cargoFeatures.features.some((v, i) => v !== this.prevCargoFeatures!.features[i]) | 183 | this.cargoFeatures.noDefaultFeatures !== |
183 | )) { | 184 | this.prevCargoFeatures.noDefaultFeatures || |
185 | this.cargoFeatures.features.length !== | ||
186 | this.prevCargoFeatures.features.length || | ||
187 | this.cargoFeatures.features.some( | ||
188 | (v, i) => v !== this.prevCargoFeatures!.features[i], | ||
189 | )) | ||
190 | ) { | ||
184 | requireReloadMessage = 'Changing cargo features requires a reload'; | 191 | requireReloadMessage = 'Changing cargo features requires a reload'; |
185 | } | 192 | } |
186 | this.prevCargoFeatures = { ...this.cargoFeatures }; | 193 | this.prevCargoFeatures = { ...this.cargoFeatures }; |