mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
use macros database in analysis
This commit is contained in:
parent
d753656192
commit
57030f587b
6 changed files with 70 additions and 68 deletions
|
@ -15,13 +15,13 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable<Vec<Hi
|
|||
.descendants()
|
||||
.filter_map(ast::MacroCall::cast)
|
||||
{
|
||||
if let Some(exp) = crate::macros::expand(db, file_id, macro_call) {
|
||||
let mapped_ranges = ra_editor::highlight(exp.source_file().syntax())
|
||||
if let Some((off, exp)) = crate::macros::expand(db, file_id, macro_call) {
|
||||
let mapped_ranges = ra_editor::highlight(exp.syntax().borrowed())
|
||||
.into_iter()
|
||||
.filter_map(|r| {
|
||||
let mapped_range = exp.map_range_back(r.range)?;
|
||||
let res = HighlightedRange {
|
||||
range: mapped_range,
|
||||
range: mapped_range + off,
|
||||
tag: r.tag,
|
||||
};
|
||||
Some(res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue