diff options
author | Mikhail Modin <[email protected]> | 2020-03-15 21:23:18 +0000 |
---|---|---|
committer | Mikhail Modin <[email protected]> | 2020-03-15 21:23:18 +0000 |
commit | b150965ed7994c679711bc807de301a12f5c7944 (patch) | |
tree | b8e4e4aed87953ead767861ce5066b8cc950f868 /crates/rust-analyzer | |
parent | 530ff9f57fd27505302d082a6007b49d8b98c8af (diff) |
Swtches to rust SSR query check
Diffstat (limited to 'crates/rust-analyzer')
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 5 | ||||
-rw-r--r-- | crates/rust-analyzer/src/req.rs | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 8dc6e8dc0..3a31a6dd7 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -906,7 +906,10 @@ pub fn handle_document_highlight( | |||
906 | 906 | ||
907 | pub fn handle_ssr(world: WorldSnapshot, params: req::SsrParams) -> Result<req::SourceChange> { | 907 | pub fn handle_ssr(world: WorldSnapshot, params: req::SsrParams) -> Result<req::SourceChange> { |
908 | let _p = profile("handle_ssr"); | 908 | let _p = profile("handle_ssr"); |
909 | world.analysis().structural_search_replace(¶ms.arg)??.try_conv_with(&world) | 909 | world |
910 | .analysis() | ||
911 | .structural_search_replace(¶ms.query, params.parse_only)?? | ||
912 | .try_conv_with(&world) | ||
910 | } | 913 | } |
911 | 914 | ||
912 | pub fn publish_diagnostics(world: &WorldSnapshot, file_id: FileId) -> Result<DiagnosticTask> { | 915 | pub fn publish_diagnostics(world: &WorldSnapshot, file_id: FileId) -> Result<DiagnosticTask> { |
diff --git a/crates/rust-analyzer/src/req.rs b/crates/rust-analyzer/src/req.rs index a3efe3b9f..435f717ae 100644 --- a/crates/rust-analyzer/src/req.rs +++ b/crates/rust-analyzer/src/req.rs | |||
@@ -217,6 +217,8 @@ impl Request for Ssr { | |||
217 | } | 217 | } |
218 | 218 | ||
219 | #[derive(Debug, Deserialize, Serialize)] | 219 | #[derive(Debug, Deserialize, Serialize)] |
220 | #[serde(rename_all = "camelCase")] | ||
220 | pub struct SsrParams { | 221 | pub struct SsrParams { |
221 | pub arg: String, | 222 | pub query: String, |
223 | pub parse_only: bool, | ||
222 | } | 224 | } |