@@ -86,6 +86,17 @@ function installCompiler() {
86
86
return exec ( `rustup toolchain install ${ configToolchain ( ) } ` )
87
87
}
88
88
89
+ /**
90
+ * @param {string } projectPath
91
+ * @return {bool } the project path has been explicitly disabled
92
+ */
93
+ function shouldIgnoreProjectPath ( projectPath ) {
94
+ const ignoredPaths = atom . config . get ( 'ide-rust.ignoredProjectPaths' )
95
+ return ignoredPaths && ignoredPaths . split ( ',' )
96
+ . map ( path => path . trim ( ) . replace ( / [ / \\ ] * $ / , '' ) )
97
+ . some ( path => path === projectPath . trim ( ) . replace ( / [ / \\ ] * $ / , '' ) )
98
+ }
99
+
89
100
/**
90
101
* @param {string } toolchain
91
102
* @return {Promise<string> } `rustc --print sysroot` stdout
@@ -270,6 +281,7 @@ class RustLanguageClient extends AutoLanguageClient {
270
281
description : 'Configuration default sent to all Rls instances, overridden by project rls.toml configuration' ,
271
282
type : 'object' ,
272
283
collapsed : false ,
284
+ order : 3 ,
273
285
properties : {
274
286
allTargets : {
275
287
title : "Check All Targets" ,
@@ -288,6 +300,12 @@ class RustLanguageClient extends AutoLanguageClient {
288
300
enum : [ "On" , "Opt-in" , "Off" , "Rls Default" ]
289
301
}
290
302
}
303
+ } ,
304
+ ignoredProjectPaths : {
305
+ description : 'Disables ide-rust functionality on a comma-separated list of project paths.' ,
306
+ type : 'string' ,
307
+ default : '' ,
308
+ order : 999
291
309
}
292
310
}
293
311
}
@@ -575,6 +593,13 @@ class RustLanguageClient extends AutoLanguageClient {
575
593
}
576
594
577
595
async startServerProcess ( projectPath ) {
596
+ if ( shouldIgnoreProjectPath ( projectPath ) ) {
597
+ console . warn ( "ide-rust disabled on" , projectPath )
598
+ // It's a bit ugly to just return as it causes some upstream error logs
599
+ // But there doesn't seem to be a better option for path disabling at the moment
600
+ return
601
+ }
602
+
578
603
if ( ! this . _periodicUpdateChecking ) {
579
604
// if haven't started periodic checks for updates yet start now
580
605
let periodicUpdateTimeoutId
0 commit comments