mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Custom ranges for missing fields
This commit is contained in:
parent
26e102a567
commit
21e5224484
4 changed files with 56 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue