File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22use crate :: model:: document:: Document ;
33use crate :: { model:: ids:: UriId , offset:: Offset } ;
44
5- #[ derive( Debug ) ]
5+ #[ derive( Debug , Clone ) ]
66pub struct Diagnostic {
77 rule : Rule ,
88 uri_id : UriId ,
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ macro_rules! namespace_declaration {
127127 self . definition_ids. extend( other. definitions( ) ) ;
128128 self . references. extend( other. references( ) ) ;
129129 self . members. extend( other. members( ) ) ;
130+ self . diagnostics. extend( other. diagnostics( ) . iter( ) . cloned( ) ) ;
130131 }
131132
132133 pub fn set_singleton_class_id( & mut self , declaration_id: DeclarationId ) {
@@ -228,6 +229,7 @@ macro_rules! simple_declaration {
228229 pub fn extend( & mut self , other: Declaration ) {
229230 self . definition_ids. extend( other. definitions( ) ) ;
230231 self . references. extend( other. references( ) ) ;
232+ self . diagnostics. extend( other. diagnostics( ) . iter( ) . cloned( ) ) ;
231233 }
232234 }
233235 } ;
@@ -393,6 +395,11 @@ impl Namespace {
393395 all_namespaces ! ( self , it => & it. members)
394396 }
395397
398+ #[ must_use]
399+ pub fn diagnostics ( & self ) -> & [ Diagnostic ] {
400+ all_namespaces ! ( self , it => & it. diagnostics)
401+ }
402+
396403 /// # Panics
397404 ///
398405 /// Panics if the declaration is not a namespace or a constant
You can’t perform that action at this time.
0 commit comments