diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-18 13:09:29 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-18 13:09:29 +0000 |
commit | 9cc4d058d2b0a8741ef67b71986b4c51b4459426 (patch) | |
tree | c4eb2e0d8dce47d503d1ed063a6b3e0fadba1c1f /crates/ra_hir_expand/src/lib.rs | |
parent | 789a0d2a6474f924a0c3239a085b5e8579b1e7f6 (diff) | |
parent | 2b6f1ab0e2303dce8e6e424514fd2a9e74566c89 (diff) |
Merge #2302
2302: Collapse TokenMap and RevTokenMap r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 73ec1688c..cfe7e6d15 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -159,7 +159,7 @@ pub struct ExpansionInfo { | |||
159 | 159 | ||
160 | macro_def: Arc<(db::TokenExpander, mbe::TokenMap)>, | 160 | macro_def: Arc<(db::TokenExpander, mbe::TokenMap)>, |
161 | macro_arg: Arc<(tt::Subtree, mbe::TokenMap)>, | 161 | macro_arg: Arc<(tt::Subtree, mbe::TokenMap)>, |
162 | exp_map: Arc<mbe::RevTokenMap>, | 162 | exp_map: Arc<mbe::TokenMap>, |
163 | } | 163 | } |
164 | 164 | ||
165 | impl ExpansionInfo { | 165 | impl ExpansionInfo { |
@@ -186,7 +186,7 @@ impl ExpansionInfo { | |||
186 | mbe::Origin::Def => (&self.macro_def.1, &self.def), | 186 | mbe::Origin::Def => (&self.macro_def.1, &self.def), |
187 | }; | 187 | }; |
188 | 188 | ||
189 | let range = token_map.relative_range_of(token_id)?; | 189 | let range = token_map.range_by_token(token_id)?; |
190 | let token = algo::find_covering_element( | 190 | let token = algo::find_covering_element( |
191 | tt.ast.syntax(), | 191 | tt.ast.syntax(), |
192 | range + tt.ast.syntax().text_range().start(), | 192 | range + tt.ast.syntax().text_range().start(), |