pub(crate) struct DiagnosticCollection {
pub(crate) native_syntax: FxHashMap<FileId, (usize, Vec<Diagnostic>)>,
pub(crate) native_semantic: FxHashMap<FileId, (usize, Vec<Diagnostic>)>,
pub(crate) check: Vec<WorkspaceFlycheckDiagnostic>,
pub(crate) check_fixes: Arc<Vec<FxHashMap<Option<PackageSpecifier>, FxHashMap<FileId, Vec<Fix>>>>>,
changes: FxHashSet<FileId>,
generation: usize,
}Fields§
§native_syntax: FxHashMap<FileId, (usize, Vec<Diagnostic>)>§native_semantic: FxHashMap<FileId, (usize, Vec<Diagnostic>)>§check: Vec<WorkspaceFlycheckDiagnostic>§check_fixes: Arc<Vec<FxHashMap<Option<PackageSpecifier>, FxHashMap<FileId, Vec<Fix>>>>>§changes: FxHashSet<FileId>§generation: usizeCounter for supplying a new generation number for diagnostics. This is used to keep track of when to clear the diagnostics for a given file as we compute diagnostics on multiple worker threads simultaneously which may result in multiple diagnostics updates for the same file in a single generation update (due to macros affecting multiple files).
Implementations§
Source§impl DiagnosticCollection
impl DiagnosticCollection
pub(crate) fn clear_check(&mut self, flycheck_id: usize)
pub(crate) fn clear_check_all(&mut self)
pub(crate) fn clear_check_for_package( &mut self, flycheck_id: usize, package_id: PackageSpecifier, )
pub(crate) fn clear_check_older_than( &mut self, flycheck_id: usize, generation: usize, )
pub(crate) fn clear_check_older_than_for_package( &mut self, flycheck_id: usize, package_id: PackageSpecifier, generation: usize, )
pub(crate) fn clear_native_for(&mut self, file_id: FileId)
pub(crate) fn add_check_diagnostic( &mut self, flycheck_id: usize, generation: usize, package_id: &Option<PackageSpecifier>, file_id: FileId, diagnostic: Diagnostic, fix: Option<Box<Fix>>, )
pub(crate) fn set_native_diagnostics(&mut self, kind: DiagnosticsTaskKind)
pub(crate) fn diagnostics_for( &self, file_id: FileId, ) -> impl Iterator<Item = &Diagnostic>
pub(crate) fn take_changes(&mut self) -> Option<FxHashSet<FileId>>
pub(crate) fn next_generation(&mut self) -> usize
Trait Implementations§
Source§impl Clone for DiagnosticCollection
impl Clone for DiagnosticCollection
Source§fn clone(&self) -> DiagnosticCollection
fn clone(&self) -> DiagnosticCollection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiagnosticCollection
impl Debug for DiagnosticCollection
Source§impl Default for DiagnosticCollection
impl Default for DiagnosticCollection
Source§fn default() -> DiagnosticCollection
fn default() -> DiagnosticCollection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DiagnosticCollection
impl RefUnwindSafe for DiagnosticCollection
impl Send for DiagnosticCollection
impl Sync for DiagnosticCollection
impl Unpin for DiagnosticCollection
impl UnsafeUnpin for DiagnosticCollection
impl UnwindSafe for DiagnosticCollection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more