diff options
author | vsrs <[email protected]> | 2020-05-17 18:38:50 +0100 |
---|---|---|
committer | vsrs <[email protected]> | 2020-05-17 18:38:50 +0100 |
commit | 3d445256fe56f4a7ead64514fb57b79079973d84 (patch) | |
tree | aabd84a5c3abe87bde1e09215b19c80055258e4c /crates | |
parent | dec2f3fa657a2700f9db1962891e7be71c299543 (diff) |
code formatting
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 30 | ||||
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 10 |
2 files changed, 21 insertions, 19 deletions
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 { | |||
244 | pub fn update_caps(&mut self, caps: &ClientCapabilities) { | 244 | pub fn update_caps(&mut self, caps: &ClientCapabilities) { |
245 | if let Some(doc_caps) = caps.text_document.as_ref() { | 245 | if let Some(doc_caps) = caps.text_document.as_ref() { |
246 | if let Some(value) = doc_caps.definition.as_ref().and_then(|it| it.link_support) { | 246 | if let Some(value) = doc_caps.definition.as_ref().and_then(|it| it.link_support) { |
247 | self.client_caps.location_link = value; | 247 | self.client_caps.location_link = value; |
248 | } | 248 | } |
249 | if let Some(value) = doc_caps.folding_range.as_ref().and_then(|it| it.line_folding_only) | 249 | if let Some(value) = doc_caps.folding_range.as_ref().and_then(|it| it.line_folding_only) |
250 | { | 250 | { |
251 | self.client_caps.line_folding_only = value | 251 | self.client_caps.line_folding_only = value |
252 | } | 252 | } |
253 | if let Some(value) = doc_caps | 253 | if let Some(value) = doc_caps |
254 | .document_symbol | 254 | .document_symbol |
255 | .as_ref() | 255 | .as_ref() |
256 | .and_then(|it| it.hierarchical_document_symbol_support) | 256 | .and_then(|it| it.hierarchical_document_symbol_support) |
257 | { | 257 | { |
258 | self.client_caps.hierarchical_symbols = value | 258 | self.client_caps.hierarchical_symbols = value |
259 | } | 259 | } |
260 | if let Some(value) = doc_caps | 260 | if let Some(value) = doc_caps |
261 | .code_action | 261 | .code_action |
262 | .as_ref() | 262 | .as_ref() |
263 | .and_then(|it| Some(it.code_action_literal_support.is_some())) | 263 | .and_then(|it| Some(it.code_action_literal_support.is_some())) |
264 | { | 264 | { |
265 | self.client_caps.code_action_literals = value; | 265 | self.client_caps.code_action_literals = value; |
266 | } | 266 | } |
267 | self.completion.allow_snippets(false); | 267 | self.completion.allow_snippets(false); |
268 | if let Some(completion) = &doc_caps.completion { | 268 | if let Some(completion) = &doc_caps.completion { |
269 | if let Some(completion_item) = &completion.completion_item { | 269 | if let Some(completion_item) = &completion.completion_item { |
270 | if let Some(value) = completion_item.snippet_support { | 270 | if let Some(value) = completion_item.snippet_support { |
271 | self.completion.allow_snippets(value); | 271 | self.completion.allow_snippets(value); |
272 | } | ||
272 | } | 273 | } |
273 | } | 274 | } |
274 | } | 275 | } |
275 | } | ||
276 | 276 | ||
277 | if let Some(window_caps) = caps.window.as_ref() { | 277 | if let Some(window_caps) = caps.window.as_ref() { |
278 | if let Some(value) = window_caps.work_done_progress { | 278 | 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( | |||
826 | if world.config.lens.runnable() { | 826 | if world.config.lens.runnable() { |
827 | // Gather runnables | 827 | // Gather runnables |
828 | for runnable in world.analysis().runnables(file_id)? { | 828 | for runnable in world.analysis().runnables(file_id)? { |
829 | let (run_title, debugee ) = match &runnable.kind { | 829 | let (run_title, debugee) = match &runnable.kind { |
830 | RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => ("▶️\u{fe0e}Run Test", true), | 830 | RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => { |
831 | RunnableKind::DocTest { .. } => { | 831 | ("▶️\u{fe0e}Run Test", true) |
832 | } | ||
833 | RunnableKind::DocTest { .. } => { | ||
832 | // cargo does not support -no-run for doctests | 834 | // cargo does not support -no-run for doctests |
833 | ("▶️\u{fe0e}Run Doctest", false) | 835 | ("▶️\u{fe0e}Run Doctest", false) |
834 | } | 836 | } |
835 | RunnableKind::Bench { .. } => { | 837 | RunnableKind::Bench { .. } => { |
836 | // Nothing wrong with bench debugging | 838 | // Nothing wrong with bench debugging |
837 | ("Run Bench", true) | 839 | ("Run Bench", true) |
838 | }, | 840 | } |
839 | RunnableKind::Bin => { | 841 | RunnableKind::Bin => { |
840 | // Do not suggest binary run on other target than binary | 842 | // Do not suggest binary run on other target than binary |
841 | match &cargo_spec { | 843 | match &cargo_spec { |