diff options
author | Aleksey Kladov <[email protected]> | 2018-12-31 16:19:50 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-01 19:15:35 +0000 |
commit | 57030f587bb0bbe4dea9a97016b4e0f49a7ef5f3 (patch) | |
tree | b30fe16afdaffcd5bb74d434101732dc20908d43 /crates/ra_analysis/src/extend_selection.rs | |
parent | d75365619212983d2b7abf7b5b5e73c70dd07fb4 (diff) |
use macros database in analysis
Diffstat (limited to 'crates/ra_analysis/src/extend_selection.rs')
-rw-r--r-- | crates/ra_analysis/src/extend_selection.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/extend_selection.rs b/crates/ra_analysis/src/extend_selection.rs index 805e9059e..62133ef29 100644 --- a/crates/ra_analysis/src/extend_selection.rs +++ b/crates/ra_analysis/src/extend_selection.rs | |||
@@ -23,10 +23,10 @@ fn extend_selection_in_macro( | |||
23 | frange: FileRange, | 23 | frange: FileRange, |
24 | ) -> Option<TextRange> { | 24 | ) -> Option<TextRange> { |
25 | let macro_call = find_macro_call(source_file.syntax(), frange.range)?; | 25 | let macro_call = find_macro_call(source_file.syntax(), frange.range)?; |
26 | let exp = crate::macros::expand(db, frange.file_id, macro_call)?; | 26 | let (off, exp) = crate::macros::expand(db, frange.file_id, macro_call)?; |
27 | let dst_range = exp.map_range_forward(frange.range)?; | 27 | let dst_range = exp.map_range_forward(frange.range - off)?; |
28 | let dst_range = ra_editor::extend_selection(exp.source_file().syntax(), dst_range)?; | 28 | let dst_range = ra_editor::extend_selection(exp.syntax().borrowed(), dst_range)?; |
29 | let src_range = exp.map_range_back(dst_range)?; | 29 | let src_range = exp.map_range_back(dst_range)? + off; |
30 | Some(src_range) | 30 | Some(src_range) |
31 | } | 31 | } |
32 | 32 | ||