File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ config_data! {
105
105
/// ```
106
106
/// .
107
107
cargo_buildScripts_overrideCommand: Option <Vec <String >> = "null" ,
108
+ /// rerun proc-macros building/build-scripts running when proc-macro
109
+ /// or build-script sources change and are saved.
110
+ cargo_buildScripts_rebuildOnSave: bool = "false" ,
108
111
/// Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
109
112
/// avoid checking unnecessary things.
110
113
cargo_buildScripts_useRustcWrapper: bool = "true" ,
@@ -1368,6 +1371,10 @@ impl Config {
1368
1371
self . data . checkOnSave
1369
1372
}
1370
1373
1374
+ pub fn script_rebuild_on_save ( & self ) -> bool {
1375
+ self . data . cargo_buildScripts_rebuildOnSave
1376
+ }
1377
+
1371
1378
pub fn runnables ( & self ) -> RunnablesConfig {
1372
1379
RunnablesConfig {
1373
1380
override_cargo : self . data . runnables_command . clone ( ) ,
Original file line number Diff line number Diff line change @@ -351,6 +351,10 @@ impl GlobalState {
351
351
352
352
crates. iter ( ) . any ( |& krate| crate_graph[ krate] . is_proc_macro )
353
353
} ) ;
354
+ if self . proc_macro_changed && self . config . script_rebuild_on_save ( ) {
355
+ self . fetch_build_data_queue
356
+ . request_op ( format ! ( "proc-macro or build script source changed" ) , ( ) )
357
+ }
354
358
}
355
359
356
360
true
You can’t perform that action at this time.
0 commit comments