From 3d445256fe56f4a7ead64514fb57b79079973d84 Mon Sep 17 00:00:00 2001 From: vsrs Date: Sun, 17 May 2020 20:38:50 +0300 Subject: code formatting --- crates/rust-analyzer/src/config.rs | 30 +++++++++++++------------- crates/rust-analyzer/src/main_loop/handlers.rs | 10 +++++---- 2 files changed, 21 insertions(+), 19 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index b99b95bfc..2038ef89b 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -244,35 +244,35 @@ impl Config { pub fn update_caps(&mut self, caps: &ClientCapabilities) { if let Some(doc_caps) = caps.text_document.as_ref() { if let Some(value) = doc_caps.definition.as_ref().and_then(|it| it.link_support) { - self.client_caps.location_link = value; - } + self.client_caps.location_link = value; + } if let Some(value) = doc_caps.folding_range.as_ref().and_then(|it| it.line_folding_only) { - self.client_caps.line_folding_only = value - } + self.client_caps.line_folding_only = value + } if let Some(value) = doc_caps .document_symbol .as_ref() .and_then(|it| it.hierarchical_document_symbol_support) - { - self.client_caps.hierarchical_symbols = value - } + { + self.client_caps.hierarchical_symbols = value + } if let Some(value) = doc_caps .code_action .as_ref() .and_then(|it| Some(it.code_action_literal_support.is_some())) - { - self.client_caps.code_action_literals = value; - } - self.completion.allow_snippets(false); + { + self.client_caps.code_action_literals = value; + } + self.completion.allow_snippets(false); if let Some(completion) = &doc_caps.completion { - if let Some(completion_item) = &completion.completion_item { - if let Some(value) = completion_item.snippet_support { - self.completion.allow_snippets(value); + if let Some(completion_item) = &completion.completion_item { + if let Some(value) = completion_item.snippet_support { + self.completion.allow_snippets(value); + } } } } - } if let Some(window_caps) = caps.window.as_ref() { if let Some(value) = window_caps.work_done_progress { diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 808532d23..e67556752 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs @@ -826,16 +826,18 @@ pub fn handle_code_lens( if world.config.lens.runnable() { // Gather runnables for runnable in world.analysis().runnables(file_id)? { - let (run_title, debugee ) = match &runnable.kind { - RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => ("▶️\u{fe0e}Run Test", true), - RunnableKind::DocTest { .. } => { + let (run_title, debugee) = match &runnable.kind { + RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => { + ("▶️\u{fe0e}Run Test", true) + } + RunnableKind::DocTest { .. } => { // cargo does not support -no-run for doctests ("▶️\u{fe0e}Run Doctest", false) } RunnableKind::Bench { .. } => { // Nothing wrong with bench debugging ("Run Bench", true) - }, + } RunnableKind::Bin => { // Do not suggest binary run on other target than binary match &cargo_spec { -- cgit v1.2.3