rust-analyzer/crates/mbe/src
bors[bot] 97409e5fc8
Merge #9970
9970: feat: Implement attribute input token mapping, fix attribute item token mapping r=Veykril a=Veykril

![image](https://user-images.githubusercontent.com/3757771/130328577-4c1ad72c-51b1-47c3-8d3d-3242ec44a355.png)

The token mapping for items with attributes got overwritten partially by the attributes non-item input, since attributes have two different inputs, the item and the direct input both.
This PR gives attributes a second TokenMap for its direct input. We now shift all normal input IDs by the item input maximum(we maybe wanna swap this see below) similar to what we do for macro-rules/def. For mapping down we then have to figure out whether we are inside the direct attribute input or its item input to pick the appropriate mapping which can be done with some token range comparisons.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9867

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-27 19:30:36 +00:00
..
expander Apply some clippy suggestions 2021-06-21 16:40:21 +02:00
tests internal: remove useless helpers 2021-08-09 15:58:21 +03:00
benchmark.rs internal: remove useless helpers 2021-08-09 15:58:21 +03:00
expander.rs Fix two more “a”/“an” typos (this time the other way) 2021-08-22 17:36:58 +02:00
lib.rs Remove MappedSubtree 2021-08-21 18:19:18 +02:00
parser.rs clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
subtree_source.rs Apply some clippy suggestions 2021-06-21 16:40:21 +02:00
syntax_bridge.rs internal: remove dead code 2021-08-14 20:29:46 +03:00
tests.rs internal: remove useless helpers 2021-08-09 15:58:21 +03:00
token_map.rs Remove MappedSubtree 2021-08-21 18:19:18 +02:00
tt_iter.rs Apply some clippy suggestions 2021-06-21 16:40:21 +02:00