aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/world.rs
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2019-12-27 10:10:07 +0000
committerEmil Lauridsen <[email protected]>2019-12-27 10:10:07 +0000
commit428a6ff5b8bad2c80a3522599195bf2a393f744e (patch)
tree9707dd343b8f00f01041a7995536aac84b137291 /crates/ra_lsp_server/src/world.rs
parent0cdbd0814958e174c5481d6bf16bd2a7e53ec981 (diff)
Move cargo watch functionality to separate crate
Diffstat (limited to 'crates/ra_lsp_server/src/world.rs')
-rw-r--r--crates/ra_lsp_server/src/world.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs
index 39a07c01a..4b3959e38 100644
--- a/crates/ra_lsp_server/src/world.rs
+++ b/crates/ra_lsp_server/src/world.rs
@@ -12,6 +12,7 @@ use crossbeam_channel::{unbounded, Receiver};
12use lsp_server::ErrorCode; 12use lsp_server::ErrorCode;
13use lsp_types::Url; 13use lsp_types::Url;
14use parking_lot::RwLock; 14use parking_lot::RwLock;
15use ra_cargo_watch::{CheckOptions, CheckWatcher, CheckWatcherSharedState};
15use ra_ide::{ 16use ra_ide::{
16 Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, 17 Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData,
17 SourceRootId, 18 SourceRootId,
@@ -23,7 +24,6 @@ use relative_path::RelativePathBuf;
23use std::path::{Component, Prefix}; 24use std::path::{Component, Prefix};
24 25
25use crate::{ 26use crate::{
26 cargo_check::{CheckWatcher, CheckWatcherSharedState},
27 main_loop::pending_requests::{CompletedRequest, LatestRequests}, 27 main_loop::pending_requests::{CompletedRequest, LatestRequests},
28 LspError, Result, 28 LspError, Result,
29}; 29};
@@ -35,10 +35,7 @@ pub struct Options {
35 pub supports_location_link: bool, 35 pub supports_location_link: bool,
36 pub line_folding_only: bool, 36 pub line_folding_only: bool,
37 pub max_inlay_hint_length: Option<usize>, 37 pub max_inlay_hint_length: Option<usize>,
38 pub cargo_watch_enable: bool, 38 pub cargo_watch: CheckOptions,
39 pub cargo_watch_args: Vec<String>,
40 pub cargo_watch_command: String,
41 pub cargo_watch_all_targets: bool,
42} 39}
43 40
44/// `WorldState` is the primary mutable state of the language server 41/// `WorldState` is the primary mutable state of the language server
@@ -135,7 +132,8 @@ impl WorldState {
135 change.set_crate_graph(crate_graph); 132 change.set_crate_graph(crate_graph);
136 133
137 // FIXME: Figure out the multi-workspace situation 134 // FIXME: Figure out the multi-workspace situation
138 let check_watcher = CheckWatcher::new(&options, folder_roots.first().cloned().unwrap()); 135 let check_watcher =
136 CheckWatcher::new(&options.cargo_watch, folder_roots.first().cloned().unwrap());
139 137
140 let mut analysis_host = AnalysisHost::new(lru_capacity, feature_flags); 138 let mut analysis_host = AnalysisHost::new(lru_capacity, feature_flags);
141 analysis_host.apply_change(change); 139 analysis_host.apply_change(change);