aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/inline_local_variable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/inline_local_variable.rs')
-rw-r--r--crates/ra_assists/src/inline_local_variable.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_assists/src/inline_local_variable.rs b/crates/ra_assists/src/inline_local_variable.rs
index 3c17089de..82c4d54b0 100644
--- a/crates/ra_assists/src/inline_local_variable.rs
+++ b/crates/ra_assists/src/inline_local_variable.rs
@@ -22,9 +22,12 @@ pub(crate) fn inline_local_varialbe(mut ctx: AssistCtx<impl HirDatabase>) -> Opt
22 .next_sibling_or_token() 22 .next_sibling_or_token()
23 .and_then(|it| ast::Whitespace::cast(it.as_token()?.clone())) 23 .and_then(|it| ast::Whitespace::cast(it.as_token()?.clone()))
24 { 24 {
25 TextRange::from_to(let_stmt.syntax().range().start(), whitespace.syntax().range().end()) 25 TextRange::from_to(
26 let_stmt.syntax().text_range().start(),
27 whitespace.syntax().text_range().end(),
28 )
26 } else { 29 } else {
27 let_stmt.syntax().range() 30 let_stmt.syntax().text_range()
28 }; 31 };
29 let analyzer = hir::SourceAnalyzer::new(ctx.db, ctx.frange.file_id, bind_pat.syntax(), None); 32 let analyzer = hir::SourceAnalyzer::new(ctx.db, ctx.frange.file_id, bind_pat.syntax(), None);
30 let refs = analyzer.find_all_refs(&bind_pat); 33 let refs = analyzer.find_all_refs(&bind_pat);