aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2019-11-18 17:02:28 +0000
committerEmil Lauridsen <[email protected]>2019-11-19 16:23:50 +0000
commitdadad36bb9770f9b13ed84bc219ea0168a7a5bf1 (patch)
tree00051540da204b4294501f3c56960975177ae502 /crates/ra_lsp_server/src/main_loop
parentc24ee0990486b04723534f072d7a58e829bbd1bd (diff)
Move type inlay hint truncation to language server
This commit implements a general truncation framework for HirFormatter that keeps track of how much has been output so far. This information can then be used to perform truncation inside the language server, instead of relying on the client. Initial support is implemented for truncating types hints using the maxInlayHintLength server config option. The existing solution in the VSCode extension has been removed in favor of letting the server truncate type hints.
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 20f9aee13..7347a78c7 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -870,7 +870,7 @@ pub fn handle_inlay_hints(
870 let analysis = world.analysis(); 870 let analysis = world.analysis();
871 let line_index = analysis.file_line_index(file_id)?; 871 let line_index = analysis.file_line_index(file_id)?;
872 Ok(analysis 872 Ok(analysis
873 .inlay_hints(file_id)? 873 .inlay_hints(file_id, world.options.max_inlay_hint_length)?
874 .into_iter() 874 .into_iter()
875 .map(|api_type| InlayHint { 875 .map(|api_type| InlayHint {
876 label: api_type.label.to_string(), 876 label: api_type.label.to_string(),