Correctly highlight ranges of diagnostics from macros

closes #2799
This commit is contained in:
Aleksey Kladov
2020-04-17 13:06:02 +02:00
parent 302bf97bbf
commit a8196ffe84
5 changed files with 89 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ use crate::{db::AstDatabase, InFile};
pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static {
fn message(&self) -> String;
fn highlight_range(&self) -> TextRange;
fn highlight_range(&self) -> InFile<TextRange>;
fn source(&self) -> InFile<SyntaxNodePtr>;
fn as_any(&self) -> &(dyn Any + Send + 'static);
}