mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
97409e5fc8
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> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |