mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Enable allFeatures
by default and fix lints
This commit is contained in:
parent
af4eb26645
commit
f56a2a0790
2 changed files with 17 additions and 10 deletions
|
@ -286,7 +286,7 @@
|
||||||
},
|
},
|
||||||
"rust-analyzer.cargoFeatures.allFeatures": {
|
"rust-analyzer.cargoFeatures.allFeatures": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"default": true,
|
||||||
"description": "Activate all available features"
|
"description": "Activate all available features"
|
||||||
},
|
},
|
||||||
"rust-analyzer.cargoFeatures.features": {
|
"rust-analyzer.cargoFeatures.features": {
|
||||||
|
|
|
@ -43,7 +43,7 @@ export class Config {
|
||||||
};
|
};
|
||||||
public cargoFeatures: CargoFeatures = {
|
public cargoFeatures: CargoFeatures = {
|
||||||
noDefaultFeatures: false,
|
noDefaultFeatures: false,
|
||||||
allFeatures: false,
|
allFeatures: true,
|
||||||
features: [],
|
features: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,7 +88,8 @@ export class Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.prevEnhancedTyping !== this.enableEnhancedTyping) {
|
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;
|
this.prevEnhancedTyping = this.enableEnhancedTyping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +166,7 @@ export class Config {
|
||||||
if (config.has('cargoFeatures.allFeatures')) {
|
if (config.has('cargoFeatures.allFeatures')) {
|
||||||
this.cargoFeatures.allFeatures = config.get(
|
this.cargoFeatures.allFeatures = config.get(
|
||||||
'cargoFeatures.allFeatures',
|
'cargoFeatures.allFeatures',
|
||||||
false,
|
true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (config.has('cargoFeatures.features')) {
|
if (config.has('cargoFeatures.features')) {
|
||||||
|
@ -175,12 +176,18 @@ export class Config {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.prevCargoFeatures !== null && (
|
if (
|
||||||
this.cargoFeatures.allFeatures !== this.prevCargoFeatures.allFeatures ||
|
this.prevCargoFeatures !== null &&
|
||||||
this.cargoFeatures.noDefaultFeatures !== this.prevCargoFeatures.noDefaultFeatures ||
|
(this.cargoFeatures.allFeatures !==
|
||||||
this.cargoFeatures.features.length !== this.prevCargoFeatures.features.length ||
|
this.prevCargoFeatures.allFeatures ||
|
||||||
this.cargoFeatures.features.some((v, i) => v !== this.prevCargoFeatures!.features[i])
|
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';
|
requireReloadMessage = 'Changing cargo features requires a reload';
|
||||||
}
|
}
|
||||||
this.prevCargoFeatures = { ...this.cargoFeatures };
|
this.prevCargoFeatures = { ...this.cargoFeatures };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue