diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 2e598fdcd..ae51141cb 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -590,6 +590,7 @@ pub fn handle_formatting( | |||
590 | let end_position = TextUnit::of_str(&file).conv_with(&file_line_index); | 590 | let end_position = TextUnit::of_str(&file).conv_with(&file_line_index); |
591 | 591 | ||
592 | let mut rustfmt = process::Command::new("rustfmt"); | 592 | let mut rustfmt = process::Command::new("rustfmt"); |
593 | rustfmt.args(&world.options.rustfmt_args); | ||
593 | if let Some(&crate_id) = crate_ids.first() { | 594 | if let Some(&crate_id) = crate_ids.first() { |
594 | // Assume all crates are in the same edition | 595 | // Assume all crates are in the same edition |
595 | let edition = world.analysis().crate_edition(crate_id)?; | 596 | let edition = world.analysis().crate_edition(crate_id)?; |
@@ -881,6 +882,11 @@ pub fn handle_document_highlight( | |||
881 | )) | 882 | )) |
882 | } | 883 | } |
883 | 884 | ||
885 | pub fn handle_ssr(world: WorldSnapshot, params: req::SsrParams) -> Result<req::SourceChange> { | ||
886 | let _p = profile("handle_ssr"); | ||
887 | world.analysis().structural_search_replace(¶ms.arg)??.try_conv_with(&world) | ||
888 | } | ||
889 | |||
884 | pub fn publish_diagnostics(world: &WorldSnapshot, file_id: FileId) -> Result<DiagnosticTask> { | 890 | pub fn publish_diagnostics(world: &WorldSnapshot, file_id: FileId) -> Result<DiagnosticTask> { |
885 | let _p = profile("publish_diagnostics"); | 891 | let _p = profile("publish_diagnostics"); |
886 | let line_index = world.analysis().file_line_index(file_id)?; | 892 | let line_index = world.analysis().file_line_index(file_id)?; |
@@ -918,9 +924,9 @@ fn to_lsp_runnable( | |||
918 | let args = runnable_args(world, file_id, &runnable.kind)?; | 924 | let args = runnable_args(world, file_id, &runnable.kind)?; |
919 | let line_index = world.analysis().file_line_index(file_id)?; | 925 | let line_index = world.analysis().file_line_index(file_id)?; |
920 | let label = match &runnable.kind { | 926 | let label = match &runnable.kind { |
921 | RunnableKind::Test { name } => format!("test {}", name), | 927 | RunnableKind::Test { test_id } => format!("test {}", test_id), |
922 | RunnableKind::TestMod { path } => format!("test-mod {}", path), | 928 | RunnableKind::TestMod { path } => format!("test-mod {}", path), |
923 | RunnableKind::Bench { name } => format!("bench {}", name), | 929 | RunnableKind::Bench { test_id } => format!("bench {}", test_id), |
924 | RunnableKind::Bin => "run binary".to_string(), | 930 | RunnableKind::Bin => "run binary".to_string(), |
925 | }; | 931 | }; |
926 | Ok(req::Runnable { | 932 | Ok(req::Runnable { |