rust/crates/ra_ide_api/src
bors[bot] 561bb979ce
Merge #2169
2169: MBE: Mapping spans for goto definition r=matklad a=edwin0cheng

Currently, go to definition gives the wrong span in MBE.  This PR implement a mapping mechanism to fix it and it could be used for future MBE hygiene implementation.

The basic idea of the mapping is:
1. When expanding the macro, generated 2 `TokenMap` which maps the macro args and macro defs between tokens and input text-ranges.
2. Before converting generated `TokenTree` to `SyntaxNode`, generated a `ExpandedRangeMap` which is a mapping between token and output text-ranges.
3. Using these 3 mappings to construct an `ExpansionInfo`  which can map between input text ranges and output text ranges.


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-11-09 09:13:14 +00:00
..
completion Merge #2179 2019-11-06 21:11:42 +00:00
display Remove map_ranges in RevTokenMap 2019-11-09 12:00:46 +08:00
references Reexport relative_path from ra_db 2019-11-04 01:14:17 +03:00
snapshots
assists.rs
call_info.rs Use match_ast! in FnCallNode::with_node 2019-10-30 14:39:05 -04:00
change.rs Reexport relative_path from ra_db 2019-11-04 01:14:17 +03:00
completion.rs
db.rs Reexport relative_path from ra_db 2019-11-04 01:14:17 +03:00
diagnostics.rs Reexport relative_path from ra_db 2019-11-04 01:14:17 +03:00
display.rs
extend_selection.rs extend selection in trait bound extends to plus 2019-10-27 21:29:06 +09:00
feature_flags.rs
folding_ranges.rs
goto_definition.rs Add tests 2019-11-05 01:38:20 +08:00
goto_type_definition.rs
hover.rs use Lazy, some fixes 2019-10-22 23:47:31 +03:00
impls.rs Move ids to hir_def crate 2019-10-30 13:11:38 +03:00
inlay_hints.rs
join_lines.rs
lib.rs refactor typing_handlers 2019-10-25 12:04:17 +03:00
line_index_utils.rs
line_index.rs
marks.rs
matching_brace.rs
mock_analysis.rs Reexport relative_path from ra_db 2019-11-04 01:14:17 +03:00
parent_module.rs Move ids to hir_def crate 2019-10-30 13:11:38 +03:00
references.rs for highlighting, search only the current file 2019-10-24 14:16:36 +03:00
runnables.rs runnables => match_ast! 2019-10-30 16:09:16 -04:00
source_change.rs Reexport relative_path from ra_db 2019-11-04 01:14:17 +03:00
status.rs Refactor and simpfily 2019-11-09 04:26:28 +08:00
symbol_index.rs
syntax_highlighting.rs use Lazy, some fixes 2019-10-22 23:47:31 +03:00
syntax_tree.rs
test_utils.rs
typing.rs Some clippy fixes 2019-10-30 13:36:37 -04:00
wasm_shims.rs