aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r--crates/ra_lsp_server/src/config.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs1
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs6
-rw-r--r--crates/ra_lsp_server/src/world.rs1
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