Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 55ff941

Browse files
committed
Only rename if there is a single def for every renamed span
Updates rls-analysis to 0.9. Closes #468
1 parent 6bf2b39 commit 55ff941

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ languageserver-types = "0.14"
1717
lazy_static = "0.2"
1818
log = "0.3"
1919
racer = "2.0.12"
20-
rls-analysis = "0.8.1"
20+
rls-analysis = "0.9"
2121
rls-data = { version = "0.12", features = ["serialize-serde"] }
2222
rls-rustc = "0.1"
2323
rls-span = { version = "0.4", features = ["serialize-serde"] }

src/actions/requests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl RequestAction for References {
330330
let span = ctx.convert_pos_to_span(file_path, params.position);
331331

332332
let result = match ctx.analysis
333-
.find_all_refs(&span, params.context.include_declaration)
333+
.find_all_refs(&span, params.context.include_declaration, false)
334334
{
335335
Ok(t) => t,
336336
_ => vec![],
@@ -424,7 +424,7 @@ impl RequestAction for DocumentHighlight {
424424
let span = ctx.convert_pos_to_span(file_path, params.position);
425425

426426
let result = ctx.analysis
427-
.find_all_refs(&span, true)
427+
.find_all_refs(&span, true, false)
428428
.unwrap_or_else(|_| vec![]);
429429

430430
Ok(
@@ -492,7 +492,7 @@ impl RequestAction for Rename {
492492
return self.fallback_response();
493493
}
494494

495-
let result = unwrap_or_fallback!(analysis.find_all_refs(&span, true));
495+
let result = unwrap_or_fallback!(analysis.find_all_refs(&span, true, true));
496496

497497
let mut edits: HashMap<Url, Vec<TextEdit>> = HashMap::new();
498498

0 commit comments

Comments
 (0)