Don't expose impl details of SyntaxPtr

This commit is contained in:
Aleksey Kladov
2020-04-17 11:38:51 +02:00
parent 69f0cb6cd7
commit 302bf97bbf
8 changed files with 55 additions and 14 deletions

View File

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