mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Merge #3540
3540: Swtches to rust SSR query check r=matklad a=mikhail-m1 related to #3186 Co-authored-by: Mikhail Modin <mikhailm1@gmail.com>
This commit is contained in:
commit
a99cac671c
7 changed files with 63 additions and 20 deletions
|
@ -932,7 +932,10 @@ pub fn handle_document_highlight(
|
|||
|
||||
pub fn handle_ssr(world: WorldSnapshot, params: req::SsrParams) -> Result<req::SourceChange> {
|
||||
let _p = profile("handle_ssr");
|
||||
world.analysis().structural_search_replace(¶ms.arg)??.try_conv_with(&world)
|
||||
world
|
||||
.analysis()
|
||||
.structural_search_replace(¶ms.query, params.parse_only)??
|
||||
.try_conv_with(&world)
|
||||
}
|
||||
|
||||
pub fn publish_diagnostics(world: &WorldSnapshot, file_id: FileId) -> Result<DiagnosticTask> {
|
||||
|
|
|
@ -218,6 +218,8 @@ impl Request for Ssr {
|
|||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SsrParams {
|
||||
pub arg: String,
|
||||
pub query: String,
|
||||
pub parse_only: bool,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue