diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-17 13:37:32 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-17 13:37:32 +0000 |
commit | 4a58522119955f36d95212be902fe3ab79c5e922 (patch) | |
tree | 56905131854a5d820a9c2b5e7d9e80484e763b41 /crates/ra_mbe | |
parent | a26840d603e672bace319f45b28dd615de1b0c2d (diff) | |
parent | 3ba4b3c554ee94cf96d62c57f9bb80eaff19beed (diff) |
Merge #2562
2562: Fix NavigationTarget ranges r=matklad a=edwin0cheng
Fix the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553
This PR change the order for finding `full_range` of `focus_range` in following orders:
1. map both ranges to macro_call
2. map focus range to a token inside macro call, and full range to the whole of macro call
3. map both ranges to the whole of macro call
And fix the corresponding tests and make these tests easily to follow.
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r-- | crates/ra_mbe/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/lib.rs b/crates/ra_mbe/src/lib.rs index 0d2d43bef..ce2deadf6 100644 --- a/crates/ra_mbe/src/lib.rs +++ b/crates/ra_mbe/src/lib.rs | |||
@@ -104,6 +104,7 @@ impl Shift { | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | #[derive(Debug, Eq, PartialEq)] | ||
107 | pub enum Origin { | 108 | pub enum Origin { |
108 | Def, | 109 | Def, |
109 | Call, | 110 | Call, |