diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-01 10:17:09 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-01 10:17:09 +0100 |
commit | 8cce752bcb83c86f300c9a8e830dd7d411f6bc48 (patch) | |
tree | eca5f6bd69dc7f7f0df5a3a4ab5ed47f5aa7255e /crates/rust-analyzer/src/main_loop.rs | |
parent | fae6cecf5434a865043ec566a6417e9bb28c3a4c (diff) | |
parent | b5306ea70659aad28b1a5de248128b47a5e5f1bf (diff) |
Merge #3802
3802: Crisper name r=matklad a=matklad
https://www.flycheck.org/en/latest/
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/rust-analyzer/src/main_loop.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index bb33fb27d..79dc03de4 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -101,11 +101,14 @@ fn get_config( | |||
101 | chaining_hints: config.inlay_hints_chaining, | 101 | chaining_hints: config.inlay_hints_chaining, |
102 | max_length: config.inlay_hints_max_length, | 102 | max_length: config.inlay_hints_max_length, |
103 | }, | 103 | }, |
104 | check: CheckConfig { | 104 | check: if config.cargo_watch_enable { |
105 | enable: config.cargo_watch_enable, | 105 | Some(CheckConfig { |
106 | args: config.cargo_watch_args.clone(), | 106 | args: config.cargo_watch_args.clone(), |
107 | command: config.cargo_watch_command.clone(), | 107 | command: config.cargo_watch_command.clone(), |
108 | all_targets: config.cargo_watch_all_targets, | 108 | all_targets: config.cargo_watch_all_targets, |
109 | }) | ||
110 | } else { | ||
111 | None | ||
109 | }, | 112 | }, |
110 | rustfmt_args: config.rustfmt_args.clone(), | 113 | rustfmt_args: config.rustfmt_args.clone(), |
111 | vscode_lldb: config.vscode_lldb, | 114 | vscode_lldb: config.vscode_lldb, |
@@ -240,7 +243,7 @@ pub fn main_loop( | |||
240 | Err(RecvError) => return Err("vfs died".into()), | 243 | Err(RecvError) => return Err("vfs died".into()), |
241 | }, | 244 | }, |
242 | recv(libdata_receiver) -> data => Event::Lib(data.unwrap()), | 245 | recv(libdata_receiver) -> data => Event::Lib(data.unwrap()), |
243 | recv(world_state.check_watcher.as_ref().map_or(&never(), |it| &it.task_recv)) -> task => match task { | 246 | recv(world_state.flycheck.as_ref().map_or(&never(), |it| &it.task_recv)) -> task => match task { |
244 | Ok(task) => Event::CheckWatcher(task), | 247 | Ok(task) => Event::CheckWatcher(task), |
245 | Err(RecvError) => return Err("check watcher died".into()), | 248 | Err(RecvError) => return Err("check watcher died".into()), |
246 | } | 249 | } |
@@ -481,8 +484,8 @@ fn loop_turn( | |||
481 | && loop_state.in_flight_libraries == 0 | 484 | && loop_state.in_flight_libraries == 0 |
482 | { | 485 | { |
483 | loop_state.workspace_loaded = true; | 486 | loop_state.workspace_loaded = true; |
484 | if let Some(check_watcher) = &world_state.check_watcher { | 487 | if let Some(flycheck) = &world_state.flycheck { |
485 | check_watcher.update(); | 488 | flycheck.update(); |
486 | } | 489 | } |
487 | pool.execute({ | 490 | pool.execute({ |
488 | let subs = loop_state.subscriptions.subscriptions(); | 491 | let subs = loop_state.subscriptions.subscriptions(); |
@@ -654,8 +657,8 @@ fn on_notification( | |||
654 | }; | 657 | }; |
655 | let not = match notification_cast::<req::DidSaveTextDocument>(not) { | 658 | let not = match notification_cast::<req::DidSaveTextDocument>(not) { |
656 | Ok(_params) => { | 659 | Ok(_params) => { |
657 | if let Some(check_watcher) = &state.check_watcher { | 660 | if let Some(flycheck) = &state.flycheck { |
658 | check_watcher.update(); | 661 | flycheck.update(); |
659 | } | 662 | } |
660 | return Ok(()); | 663 | return Ok(()); |
661 | } | 664 | } |