diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-31 15:06:03 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-31 15:06:03 +0100 |
commit | fa3c7742af9fbfe5146f4158a6119fa727dcc87a (patch) | |
tree | 897858f9eae6d759f5bc7187a18a70ecb8a45cc3 /crates/rust-analyzer/src/main_loop.rs | |
parent | 6546edc0651260f74a7e0c121120c487791d7f6d (diff) | |
parent | 569f47e427e0b9181075291c988446b86c5ba8f9 (diff) |
Merge #3790
3790: Better names for config structs r=matklad a=matklad
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 | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index d818243e3..c233f72ff 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -21,8 +21,8 @@ use lsp_types::{ | |||
21 | WorkDoneProgressBegin, WorkDoneProgressCreateParams, WorkDoneProgressEnd, | 21 | WorkDoneProgressBegin, WorkDoneProgressCreateParams, WorkDoneProgressEnd, |
22 | WorkDoneProgressReport, | 22 | WorkDoneProgressReport, |
23 | }; | 23 | }; |
24 | use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckOptions, CheckTask}; | 24 | use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckConfig, CheckTask}; |
25 | use ra_ide::{Canceled, FileId, InlayHintsOptions, LibraryData, SourceRootId}; | 25 | use ra_ide::{Canceled, FileId, InlayHintsConfig, LibraryData, SourceRootId}; |
26 | use ra_prof::profile; | 26 | use ra_prof::profile; |
27 | use ra_vfs::{VfsFile, VfsTask, Watch}; | 27 | use ra_vfs::{VfsFile, VfsTask, Watch}; |
28 | use relative_path::RelativePathBuf; | 28 | use relative_path::RelativePathBuf; |
@@ -38,7 +38,7 @@ use crate::{ | |||
38 | subscriptions::Subscriptions, | 38 | subscriptions::Subscriptions, |
39 | }, | 39 | }, |
40 | req, | 40 | req, |
41 | world::{Options, WorldSnapshot, WorldState}, | 41 | world::{Config, WorldSnapshot, WorldState}, |
42 | Result, ServerConfig, | 42 | Result, ServerConfig, |
43 | }; | 43 | }; |
44 | use req::ConfigurationParams; | 44 | use req::ConfigurationParams; |
@@ -81,11 +81,11 @@ fn get_feature_flags(config: &ServerConfig, connection: &Connection) -> FeatureF | |||
81 | ff | 81 | ff |
82 | } | 82 | } |
83 | 83 | ||
84 | fn get_options( | 84 | fn get_config( |
85 | config: &ServerConfig, | 85 | config: &ServerConfig, |
86 | text_document_caps: Option<&TextDocumentClientCapabilities>, | 86 | text_document_caps: Option<&TextDocumentClientCapabilities>, |
87 | ) -> Options { | 87 | ) -> Config { |
88 | Options { | 88 | Config { |
89 | publish_decorations: config.publish_decorations, | 89 | publish_decorations: config.publish_decorations, |
90 | supports_location_link: text_document_caps | 90 | supports_location_link: text_document_caps |
91 | .and_then(|it| it.definition) | 91 | .and_then(|it| it.definition) |
@@ -95,13 +95,13 @@ fn get_options( | |||
95 | .and_then(|it| it.folding_range.as_ref()) | 95 | .and_then(|it| it.folding_range.as_ref()) |
96 | .and_then(|it| it.line_folding_only) | 96 | .and_then(|it| it.line_folding_only) |
97 | .unwrap_or(false), | 97 | .unwrap_or(false), |
98 | inlay_hints: InlayHintsOptions { | 98 | inlay_hints: InlayHintsConfig { |
99 | type_hints: config.inlay_hints_type, | 99 | type_hints: config.inlay_hints_type, |
100 | parameter_hints: config.inlay_hints_parameter, | 100 | parameter_hints: config.inlay_hints_parameter, |
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 | cargo_watch: CheckOptions { | 104 | check: CheckConfig { |
105 | enable: config.cargo_watch_enable, | 105 | enable: config.cargo_watch_enable, |
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(), |
@@ -210,7 +210,7 @@ pub fn main_loop( | |||
210 | config.lru_capacity, | 210 | config.lru_capacity, |
211 | &globs, | 211 | &globs, |
212 | Watch(!config.use_client_watching), | 212 | Watch(!config.use_client_watching), |
213 | get_options(&config, text_document_caps), | 213 | get_config(&config, text_document_caps), |
214 | feature_flags, | 214 | feature_flags, |
215 | ) | 215 | ) |
216 | }; | 216 | }; |
@@ -435,7 +435,7 @@ fn loop_turn( | |||
435 | .to_owned(); | 435 | .to_owned(); |
436 | world_state.update_configuration( | 436 | world_state.update_configuration( |
437 | new_config.lru_capacity, | 437 | new_config.lru_capacity, |
438 | get_options(&new_config, text_document_caps), | 438 | get_config(&new_config, text_document_caps), |
439 | get_feature_flags(&new_config, connection), | 439 | get_feature_flags(&new_config, connection), |
440 | ); | 440 | ); |
441 | } | 441 | } |
@@ -498,7 +498,7 @@ fn loop_turn( | |||
498 | update_file_notifications_on_threadpool( | 498 | update_file_notifications_on_threadpool( |
499 | pool, | 499 | pool, |
500 | world_state.snapshot(), | 500 | world_state.snapshot(), |
501 | world_state.options.publish_decorations, | 501 | world_state.config.publish_decorations, |
502 | task_sender.clone(), | 502 | task_sender.clone(), |
503 | loop_state.subscriptions.subscriptions(), | 503 | loop_state.subscriptions.subscriptions(), |
504 | ) | 504 | ) |