Custom ranges for missing fields

This commit is contained in:
Kirill Bulatov 2020-07-27 18:45:08 +03:00
parent 26e102a567
commit 21e5224484
4 changed files with 56 additions and 8 deletions

View file

@ -100,8 +100,10 @@ pub(crate) fn diagnostics(
};
res.borrow_mut().push(Diagnostic {
// TODO kb use a smaller range here
range,
range: d
.list_parent_ast(db)
.map(|path| path.syntax().text_range())
.unwrap_or(range),
message: d.message(),
severity: Severity::Error,
fix,