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/main.rs11
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs8
2 files changed, 11 insertions, 8 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")]
29struct InitializationOptions { 29struct 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
33fn main_inner() -> Result<()> { 36fn 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...");
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 565ec92af..a5a2b5eec 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -54,7 +54,7 @@ enum Task {
54pub fn main_loop( 54pub fn main_loop(
55 internal_mode: bool, 55 internal_mode: bool,
56 ws_root: PathBuf, 56 ws_root: PathBuf,
57 publish_decorations: bool, 57 supports_decorations: bool,
58 msg_receiver: &Receiver<RawMessage>, 58 msg_receiver: &Receiver<RawMessage>,
59 msg_sender: &Sender<RawMessage>, 59 msg_sender: &Sender<RawMessage>,
60) -> Result<()> { 60) -> Result<()> {
@@ -83,7 +83,7 @@ pub fn main_loop(
83 let mut subs = Subscriptions::new(); 83 let mut subs = Subscriptions::new();
84 let main_res = main_loop_inner( 84 let main_res = main_loop_inner(
85 internal_mode, 85 internal_mode,
86 publish_decorations, 86 supports_decorations,
87 &pool, 87 &pool,
88 msg_sender, 88 msg_sender,
89 msg_receiver, 89 msg_receiver,
@@ -156,7 +156,7 @@ impl fmt::Debug for Event {
156 156
157fn main_loop_inner( 157fn main_loop_inner(
158 internal_mode: bool, 158 internal_mode: bool,
159 publish_decorations: bool, 159 supports_decorations: bool,
160 pool: &ThreadPool, 160 pool: &ThreadPool,
161 msg_sender: &Sender<RawMessage>, 161 msg_sender: &Sender<RawMessage>,
162 msg_receiver: &Receiver<RawMessage>, 162 msg_receiver: &Receiver<RawMessage>,
@@ -240,7 +240,7 @@ fn main_loop_inner(
240 update_file_notifications_on_threadpool( 240 update_file_notifications_on_threadpool(
241 pool, 241 pool,
242 state.snapshot(), 242 state.snapshot(),
243 publish_decorations, 243 supports_decorations,
244 task_sender.clone(), 244 task_sender.clone(),
245 subs.subscriptions(), 245 subs.subscriptions(),
246 ) 246 )