diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index ab2b81bf0..aa55d1255 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -123,7 +123,7 @@ pub fn handle_on_type_formatting( | |||
123 | let edit = edit.source_file_edits.pop().unwrap(); | 123 | let edit = edit.source_file_edits.pop().unwrap(); |
124 | 124 | ||
125 | let change: Vec<TextEdit> = edit.edit.conv_with(&line_index); | 125 | let change: Vec<TextEdit> = edit.edit.conv_with(&line_index); |
126 | return Ok(Some(change)); | 126 | Ok(Some(change)) |
127 | } | 127 | } |
128 | 128 | ||
129 | pub fn handle_document_symbol( | 129 | pub fn handle_document_symbol( |
@@ -319,7 +319,7 @@ pub fn handle_runnables( | |||
319 | args: check_args, | 319 | args: check_args, |
320 | env: FxHashMap::default(), | 320 | env: FxHashMap::default(), |
321 | }); | 321 | }); |
322 | return Ok(res); | 322 | Ok(res) |
323 | } | 323 | } |
324 | 324 | ||
325 | pub fn handle_decorations( | 325 | pub fn handle_decorations( |
@@ -622,10 +622,8 @@ pub fn handle_code_lens( | |||
622 | // Gather runnables | 622 | // Gather runnables |
623 | for runnable in world.analysis().runnables(file_id)? { | 623 | for runnable in world.analysis().runnables(file_id)? { |
624 | let title = match &runnable.kind { | 624 | let title = match &runnable.kind { |
625 | RunnableKind::Test { name: _ } | RunnableKind::TestMod { path: _ } => { | 625 | RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => Some("▶️Run Test"), |
626 | Some("▶️Run Test") | 626 | RunnableKind::Bench { .. } => Some("Run Bench"), |
627 | } | ||
628 | RunnableKind::Bench { name: _ } => Some("Run Bench"), | ||
629 | _ => None, | 627 | _ => None, |
630 | }; | 628 | }; |
631 | 629 | ||
@@ -679,7 +677,7 @@ pub fn handle_code_lens( | |||
679 | }), | 677 | }), |
680 | ); | 678 | ); |
681 | 679 | ||
682 | return Ok(Some(lenses)); | 680 | Ok(Some(lenses)) |
683 | } | 681 | } |
684 | 682 | ||
685 | #[derive(Debug, Serialize, Deserialize)] | 683 | #[derive(Debug, Serialize, Deserialize)] |
@@ -722,22 +720,20 @@ pub fn handle_code_lens_resolve(world: ServerWorld, code_lens: CodeLens) -> Resu | |||
722 | to_value(locations).unwrap(), | 720 | to_value(locations).unwrap(), |
723 | ]), | 721 | ]), |
724 | }; | 722 | }; |
725 | return Ok(CodeLens { | 723 | Ok(CodeLens { |
726 | range: code_lens.range, | 724 | range: code_lens.range, |
727 | command: Some(cmd), | 725 | command: Some(cmd), |
728 | data: None, | 726 | data: None, |
729 | }); | 727 | }) |
730 | } | ||
731 | None => { | ||
732 | return Ok(CodeLens { | ||
733 | range: code_lens.range, | ||
734 | command: Some(Command { | ||
735 | title: "Error".into(), | ||
736 | ..Default::default() | ||
737 | }), | ||
738 | data: None, | ||
739 | }); | ||
740 | } | 728 | } |
729 | None => Ok(CodeLens { | ||
730 | range: code_lens.range, | ||
731 | command: Some(Command { | ||
732 | title: "Error".into(), | ||
733 | ..Default::default() | ||
734 | }), | ||
735 | data: None, | ||
736 | }), | ||
741 | } | 737 | } |
742 | } | 738 | } |
743 | 739 | ||