This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,20 @@ function installCompiler() {
90
90
* @return {Promise<string> } `rustc --print sysroot` stdout
91
91
*/
92
92
async function rustcSysroot ( toolchain ) {
93
- let { stdout } = await exec ( `rustup run ${ toolchain } rustc --print sysroot` )
94
- return stdout . trim ( )
93
+ try {
94
+ let { stdout } = await exec ( `rustup run ${ toolchain } rustc --print sysroot` )
95
+ return stdout . trim ( )
96
+ }
97
+ catch ( e ) {
98
+ // make an attempt to use system rustc
99
+ try {
100
+ let { stdout } = await exec ( `rustc --print sysroot` )
101
+ return stdout . trim ( )
102
+ }
103
+ catch ( sys_e ) {
104
+ throw e
105
+ }
106
+ }
95
107
}
96
108
97
109
/** @return {string } environment variable path */
@@ -483,6 +495,11 @@ class RustLanguageClient extends AutoLanguageClient {
483
495
// Watch config toolchain changes -> switch, install & update toolchains, restart servers
484
496
this . disposables . add ( atom . config . onDidChange ( 'ide-rust.rlsToolchain' ,
485
497
_ . debounce ( ( { newValue } ) => {
498
+ if ( rlsCommandOverride ( ) ) {
499
+ // don't bother checking toolchain if an override is being used
500
+ return
501
+ }
502
+
486
503
return this . _checkToolchain ( )
487
504
. then ( ( ) => checkRls ( this . busySignalService ) )
488
505
. then ( ( ) => this . _restartLanguageServers ( `Switched Rls toolchain to \`${ newValue } \`` ) )
You can’t perform that action at this time.
0 commit comments