Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 3ac7284

Browse files
committed
Suggest dated nightly when using nightly override without rls
1 parent 27ba8c7 commit 3ac7284

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ async function installRlsComponents(toolchain, cwd) {
198198
let suggestedVersion
199199
let usingRustupOverride = false
200200

201-
if (toolchain.startsWith('nightly')) {
202-
// 'rls-preview' not available search for a decent suggestion
203-
suggestedVersion = await suggestChannelOrDated('nightly').catch(e => console.warn(e))
204-
} else if (!toolchain) {
201+
if (!toolchain) {
205202
// check if using a rustup override
206203
let override = (await rustupOverrides()).find(({ path }) => cwd.startsWith(path))
207204
if (override) {
@@ -210,6 +207,11 @@ async function installRlsComponents(toolchain, cwd) {
210207
}
211208
}
212209

210+
if (toolchain.startsWith('nightly')) {
211+
// 'rls' not available search for a decent suggestion
212+
suggestedVersion = await suggestChannelOrDated('nightly').catch(logErr)
213+
}
214+
213215
const note = {
214216
detail: 'Try configuring another toolchain, like a dated nightly or `beta`',
215217
dismissable: true,
@@ -219,14 +221,17 @@ async function installRlsComponents(toolchain, cwd) {
219221
onDidClick: () => atom.workspace.open('atom://config/packages/ide-rust')
220222
}]
221223
}
222-
if (suggestedVersion) {
224+
if (suggestedVersion && !usingRustupOverride) {
223225
note.buttons.push({
224226
text: `Use ${suggestedVersion}`,
225227
onDidClick: () => atom.config.set('ide-rust.rlsToolchain', suggestedVersion)
226228
})
227229
}
228230

229231
if (usingRustupOverride) {
232+
note.detail = "Try removing your rustup override or reconfiguring to a dated nightly or `beta`"
233+
if (suggestedVersion)
234+
note.detail = note.detail.replace("a dated nightly", `\`${suggestedVersion}\``)
230235
atom.notifications
231236
.addError(`\`rls\` was not found on rustup override \`${toolchain}\``, note)
232237
} else {

0 commit comments

Comments
 (0)