Handle macros in TestDB::check_diagnostics
This commit is contained in:
parent
0ce0d6893b
commit
678c74430b
@ -157,9 +157,16 @@ pub(crate) fn check_diagnostics(&self) {
|
||||
db.diagnostics(|d| {
|
||||
let src = d.display_source();
|
||||
let root = db.parse_or_expand(src.file_id).unwrap();
|
||||
// FIXME: macros...
|
||||
|
||||
// Place all diagnostics emitted in macro files on the original caller.
|
||||
// Note that this does *not* match IDE behavior.
|
||||
let mut src = src.map(|ptr| ptr.to_node(&root));
|
||||
while let Some(exp) = src.file_id.call_node(db) {
|
||||
src = exp;
|
||||
}
|
||||
|
||||
let file_id = src.file_id.original_file(db);
|
||||
let range = src.value.to_node(&root).text_range();
|
||||
let range = src.value.text_range();
|
||||
let message = d.message().to_owned();
|
||||
actual.entry(file_id).or_default().push((range, message));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user