diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-24 13:47:27 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-24 13:47:27 +0000 |
commit | b052059f868e4b890425c43e1e16d195d3c453d9 (patch) | |
tree | d761a1ec0346286f20c511ff8f76111313d30957 /crates/ra_lsp_server/src/main.rs | |
parent | d77520fde3c953968beb09a3da80a0e7b17bbc04 (diff) | |
parent | ecab036d6ffcb85c45a288b312d79141bcd86fd9 (diff) |
Merge #302
302: WIP: Support tracing lsp requests. r=DJMcNab a=DJMcNab
EDIT: We need to work out a better way to handle settings before this can be merged. Help wanted
TODO: Debug why decorations are sent even when highlightingOn is disabled
This makes the log volume so high its impossible to work with anyway.
(Continuation of #84 [#99 only disabled using it, not making sure we don't send it]).
These logs can be used in https://microsoft.github.io/language-server-protocol/inspector/
Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src/main.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs index eae601f91..33aa30d70 100644 --- a/crates/ra_lsp_server/src/main.rs +++ b/crates/ra_lsp_server/src/main.rs | |||
@@ -27,7 +27,10 @@ fn main() -> Result<()> { | |||
27 | #[derive(Deserialize)] | 27 | #[derive(Deserialize)] |
28 | #[serde(rename_all = "camelCase")] | 28 | #[serde(rename_all = "camelCase")] |
29 | struct InitializationOptions { | 29 | struct InitializationOptions { |
30 | publish_decorations: bool, | 30 | // Whether the client supports our custom highlighting publishing decorations. |
31 | // This is different to the highlightingOn setting, which is whether the user | ||
32 | // wants our custom highlighting to be used. | ||
33 | publish_decorations: Option<bool>, | ||
31 | } | 34 | } |
32 | 35 | ||
33 | fn main_inner() -> Result<()> { | 36 | fn main_inner() -> Result<()> { |
@@ -42,12 +45,12 @@ fn main_inner() -> Result<()> { | |||
42 | .root_uri | 45 | .root_uri |
43 | .and_then(|it| it.to_file_path().ok()) | 46 | .and_then(|it| it.to_file_path().ok()) |
44 | .unwrap_or(cwd); | 47 | .unwrap_or(cwd); |
45 | let publish_decorations = params | 48 | let supports_decorations = params |
46 | .initialization_options | 49 | .initialization_options |
47 | .and_then(|v| InitializationOptions::deserialize(v).ok()) | 50 | .and_then(|v| InitializationOptions::deserialize(v).ok()) |
48 | .map(|it| it.publish_decorations) | 51 | .and_then(|it| it.publish_decorations) |
49 | == Some(true); | 52 | == Some(true); |
50 | ra_lsp_server::main_loop(false, root, publish_decorations, r, s) | 53 | ra_lsp_server::main_loop(false, root, supports_decorations, r, s) |
51 | }, | 54 | }, |
52 | )?; | 55 | )?; |
53 | log::info!("shutting down IO..."); | 56 | log::info!("shutting down IO..."); |