diff options
author | Kirill Bulatov <[email protected]> | 2019-12-07 22:54:18 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2019-12-19 10:27:33 +0000 |
commit | 14c167a9f6da07024a5101ffa04bc2f79ce64353 (patch) | |
tree | a5fc10aaa8ed0cad0c08a9ff478acb23795aa322 /crates/ra_lsp_server | |
parent | 8dd0e0086fc07422c9b1044b1db021cff6563214 (diff) |
Omit default parameter types
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/config.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 1 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 6 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/world.rs | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/config.rs b/crates/ra_lsp_server/src/config.rs index 67942aa41..a916c5fd6 100644 --- a/crates/ra_lsp_server/src/config.rs +++ b/crates/ra_lsp_server/src/config.rs | |||
@@ -31,6 +31,7 @@ pub struct ServerConfig { | |||
31 | pub lru_capacity: Option<usize>, | 31 | pub lru_capacity: Option<usize>, |
32 | 32 | ||
33 | pub max_inlay_hint_length: Option<usize>, | 33 | pub max_inlay_hint_length: Option<usize>, |
34 | pub show_default_types_in_inlay_hints: bool, | ||
34 | 35 | ||
35 | /// For internal usage to make integrated tests faster. | 36 | /// For internal usage to make integrated tests faster. |
36 | #[serde(deserialize_with = "nullable_bool_true")] | 37 | #[serde(deserialize_with = "nullable_bool_true")] |
@@ -51,6 +52,7 @@ impl Default for ServerConfig { | |||
51 | use_client_watching: false, | 52 | use_client_watching: false, |
52 | lru_capacity: None, | 53 | lru_capacity: None, |
53 | max_inlay_hint_length: None, | 54 | max_inlay_hint_length: None, |
55 | show_default_types_in_inlay_hints: false, | ||
54 | with_sysroot: true, | 56 | with_sysroot: true, |
55 | feature_flags: FxHashMap::default(), | 57 | feature_flags: FxHashMap::default(), |
56 | cargo_features: Default::default(), | 58 | cargo_features: Default::default(), |
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 965e7c53c..01fde3b2d 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -125,6 +125,7 @@ pub fn main_loop( | |||
125 | .and_then(|it| it.line_folding_only) | 125 | .and_then(|it| it.line_folding_only) |
126 | .unwrap_or(false), | 126 | .unwrap_or(false), |
127 | max_inlay_hint_length: config.max_inlay_hint_length, | 127 | max_inlay_hint_length: config.max_inlay_hint_length, |
128 | show_default_types_in_inlay_hints: config.show_default_types_in_inlay_hints, | ||
128 | } | 129 | } |
129 | }; | 130 | }; |
130 | 131 | ||
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 5b64b27cd..9069d1f1d 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -895,7 +895,11 @@ pub fn handle_inlay_hints( | |||
895 | let analysis = world.analysis(); | 895 | let analysis = world.analysis(); |
896 | let line_index = analysis.file_line_index(file_id)?; | 896 | let line_index = analysis.file_line_index(file_id)?; |
897 | Ok(analysis | 897 | Ok(analysis |
898 | .inlay_hints(file_id, world.options.max_inlay_hint_length)? | 898 | .inlay_hints( |
899 | file_id, | ||
900 | world.options.max_inlay_hint_length, | ||
901 | world.options.show_default_types_in_inlay_hints, | ||
902 | )? | ||
899 | .into_iter() | 903 | .into_iter() |
900 | .map(|api_type| InlayHint { | 904 | .map(|api_type| InlayHint { |
901 | label: api_type.label.to_string(), | 905 | label: api_type.label.to_string(), |
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index 16cc11e8c..0b6eefcbc 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs | |||
@@ -31,6 +31,7 @@ pub struct Options { | |||
31 | pub supports_location_link: bool, | 31 | pub supports_location_link: bool, |
32 | pub line_folding_only: bool, | 32 | pub line_folding_only: bool, |
33 | pub max_inlay_hint_length: Option<usize>, | 33 | pub max_inlay_hint_length: Option<usize>, |
34 | pub show_default_types_in_inlay_hints: bool, | ||
34 | } | 35 | } |
35 | 36 | ||
36 | /// `WorldState` is the primary mutable state of the language server | 37 | /// `WorldState` is the primary mutable state of the language server |