Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit b98fce9

Browse files
authored
Merge pull request #712 from Steven0351/default-channel
Specify Default Toolchain as Active Channel
2 parents e684cea + cd2047c commit b98fce9

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
"null"
199199
],
200200
"enum": [
201+
"default",
201202
"stable",
202203
"beta",
203204
"nightly"

src/configuration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ export class RLSConfiguration {
6262
configuration: WorkspaceConfiguration,
6363
): string {
6464
const channel = configuration.get<string>('rust-client.channel');
65-
if (channel) {
66-
return channel;
67-
} else {
65+
if (channel === 'default' || !channel) {
6866
try {
6967
return getActiveChannel(wsPath, rustupConfiguration);
7068
} catch (e) {
7169
// rustup might not be installed at the time the configuration is
7270
// initially loaded, so silently ignore the error and return a default value
7371
return 'nightly';
7472
}
73+
} else {
74+
return channel;
7575
}
7676
}
7777

src/rustup.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ export function getActiveChannel(wsPath: string, config: RustupConfig): string {
273273
activeChannel = parseActiveToolchain(showOutput);
274274
}
275275

276-
console.info(
277-
`Detected active channel: ${activeChannel} (since 'rust-client.channel' is unspecified)`,
278-
);
276+
console.info(`Using active channel: ${activeChannel}`);
279277
return activeChannel;
280278
}

0 commit comments

Comments
 (0)