rust-analyzer/crates/hir/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
..
semantics fix: Fix multiple derives in one attribute not expanding all in expand_macro 2021-08-26 03:32:45 +02:00
attrs.rs resolve_doc_path is able to resolve to macros 2021-08-02 14:33:09 +02:00
db.rs Add more docs 2021-05-22 16:53:47 +03:00
diagnostics.rs Add reference here diagnostic 2021-08-08 10:12:40 +02:00
display.rs Handle impl ?Sized. Fix tests. 2021-08-04 20:20:10 +05:00
from_id.rs Stop reexporting hir_def's ItemInNs from HIR 2021-07-28 17:39:04 +02:00
has_source.rs Add trait codegen to add_missing_impl_members assist 2021-08-10 10:27:52 +02:00
lib.rs Add reference here diagnostic 2021-08-08 10:12:40 +02:00
semantics.rs Merge #9970 2021-08-27 19:30:36 +00:00
source_analyzer.rs Fix some clippy lints 2021-08-16 22:04:26 +03:00