@@ -198,10 +198,7 @@ async function installRlsComponents(toolchain, cwd) {
198
198
let suggestedVersion
199
199
let usingRustupOverride = false
200
200
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 ) {
205
202
// check if using a rustup override
206
203
let override = ( await rustupOverrides ( ) ) . find ( ( { path } ) => cwd . startsWith ( path ) )
207
204
if ( override ) {
@@ -210,6 +207,11 @@ async function installRlsComponents(toolchain, cwd) {
210
207
}
211
208
}
212
209
210
+ if ( toolchain . startsWith ( 'nightly' ) ) {
211
+ // 'rls' not available search for a decent suggestion
212
+ suggestedVersion = await suggestChannelOrDated ( 'nightly' ) . catch ( logErr )
213
+ }
214
+
213
215
const note = {
214
216
detail : 'Try configuring another toolchain, like a dated nightly or `beta`' ,
215
217
dismissable : true ,
@@ -219,14 +221,17 @@ async function installRlsComponents(toolchain, cwd) {
219
221
onDidClick : ( ) => atom . workspace . open ( 'atom://config/packages/ide-rust' )
220
222
} ]
221
223
}
222
- if ( suggestedVersion ) {
224
+ if ( suggestedVersion && ! usingRustupOverride ) {
223
225
note . buttons . push ( {
224
226
text : `Use ${ suggestedVersion } ` ,
225
227
onDidClick : ( ) => atom . config . set ( 'ide-rust.rlsToolchain' , suggestedVersion )
226
228
} )
227
229
}
228
230
229
231
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 } \`` )
230
235
atom . notifications
231
236
. addError ( `\`rls\` was not found on rustup override \`${ toolchain } \`` , note )
232
237
} else {
0 commit comments