File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 55//!
66//! `DiagnosticSink` struct is used as an emitter for diagnostic. When creating
77//! a `DiagnosticSink`, you supply a callback which can react to a `dyn
8- //! Diagnostic` or to any concrete diagnostic (downcasting is sued internally).
8+ //! Diagnostic` or to any concrete diagnostic (downcasting is used internally).
99//!
1010//! Because diagnostics store file offsets, it's a bad idea to store them
1111//! directly in salsa. For this reason, every hir subsytem defines it's own
@@ -32,7 +32,12 @@ impl DiagnosticCode {
3232pub trait Diagnostic : Any + Send + Sync + fmt:: Debug + ' static {
3333 fn code ( & self ) -> DiagnosticCode ;
3434 fn message ( & self ) -> String ;
35- /// Used in highlighting and related purposes
35+ /// Source element that triggered the diagnostics.
36+ ///
37+ /// Note that this should reflect "semantics", rather than specific span we
38+ /// want to highlight. When rendering the diagnostics into an error message,
39+ /// the IDE will fetch the `SyntaxNode` and will narrow the span
40+ /// appropriately.
3641 fn display_source ( & self ) -> InFile < SyntaxNodePtr > ;
3742 fn as_any ( & self ) -> & ( dyn Any + Send + ' static ) ;
3843 fn is_experimental ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments