mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
use token_ancestors_with_macros to simplify goto-def on kw
This commit is contained in:
parent
22c5924080
commit
ae6e8d56d4
2 changed files with 45 additions and 83 deletions
|
@ -541,11 +541,7 @@ fn original_range(
|
|||
file_id: HirFileId,
|
||||
text_range: Option<TextRange>,
|
||||
) -> Option<TextRange> {
|
||||
if text_range.is_none() || !file_id.is_macro() {
|
||||
return text_range;
|
||||
}
|
||||
|
||||
InFile::new(file_id, text_range.unwrap())
|
||||
InFile::new(file_id, text_range?)
|
||||
.original_node_file_range_opt(db)
|
||||
.map(|(frange, _)| frange.range)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue