@@ -4,7 +4,6 @@ use line_index::LineIndex;
44use url:: Url ;
55
66use crate :: diagnostic:: Diagnostic ;
7- use crate :: model:: identity_maps:: IdentityHashMap ;
87use crate :: model:: ids:: { DefinitionId , ReferenceId } ;
98
109// Represents a document currently loaded into memory. Identified by its unique URI, it holds the edges to all
@@ -17,8 +16,6 @@ pub struct Document {
1716 method_reference_ids : Vec < ReferenceId > ,
1817 constant_reference_ids : Vec < ReferenceId > ,
1918 diagnostics : Vec < Diagnostic > ,
20- definition_diagnostics : IdentityHashMap < DefinitionId , Vec < Diagnostic > > ,
21- reference_diagnostics : IdentityHashMap < ReferenceId , Vec < Diagnostic > > ,
2219}
2320
2421impl Document {
@@ -31,8 +28,6 @@ impl Document {
3128 method_reference_ids : Vec :: new ( ) ,
3229 constant_reference_ids : Vec :: new ( ) ,
3330 diagnostics : Vec :: new ( ) ,
34- definition_diagnostics : IdentityHashMap :: default ( ) ,
35- reference_diagnostics : IdentityHashMap :: default ( ) ,
3631 }
3732 }
3833
@@ -87,31 +82,6 @@ impl Document {
8782 self . diagnostics . push ( diagnostic) ;
8883 }
8984
90- #[ must_use]
91- pub fn diagnostics_for_definition ( & self , id : DefinitionId ) -> & [ Diagnostic ] {
92- self . definition_diagnostics . get ( & id) . map_or ( & [ ] , Vec :: as_slice)
93- }
94-
95- pub fn add_diagnostic_for_definition ( & mut self , id : DefinitionId , diagnostic : Diagnostic ) {
96- self . definition_diagnostics . entry ( id) . or_default ( ) . push ( diagnostic) ;
97- }
98-
99- #[ must_use]
100- pub fn diagnostics_for_reference ( & self , id : ReferenceId ) -> & [ Diagnostic ] {
101- self . reference_diagnostics . get ( & id) . map_or ( & [ ] , Vec :: as_slice)
102- }
103-
104- pub fn add_diagnostic_for_reference ( & mut self , id : ReferenceId , diagnostic : Diagnostic ) {
105- self . reference_diagnostics . entry ( id) . or_default ( ) . push ( diagnostic) ;
106- }
107-
108- pub fn all_diagnostics ( & self ) -> impl Iterator < Item = & Diagnostic > {
109- self . diagnostics
110- . iter ( )
111- . chain ( self . definition_diagnostics . values ( ) . flatten ( ) )
112- . chain ( self . reference_diagnostics . values ( ) . flatten ( ) )
113- }
114-
11585 /// Computes the require path for this document given load paths.
11686 ///
11787 /// Returns `None` if:
0 commit comments