mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
fix(els): duplicated diagnostics
This commit is contained in:
parent
72ef581522
commit
5497af5626
4 changed files with 25 additions and 6 deletions
|
@ -1,21 +1,21 @@
|
|||
use std::path::Path;
|
||||
|
||||
use erg_common::pathutil::NormalizedPathBuf;
|
||||
use erg_common::set::Set;
|
||||
use erg_common::shared::Shared;
|
||||
use erg_common::traits::Stream;
|
||||
|
||||
use crate::error::{CompileError, CompileErrors};
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct SharedCompileErrors(Shared<CompileErrors>);
|
||||
pub struct SharedCompileErrors(Shared<Set<CompileError>>);
|
||||
|
||||
impl SharedCompileErrors {
|
||||
pub fn new() -> Self {
|
||||
Self(Shared::new(CompileErrors::empty()))
|
||||
Self(Shared::new(Set::new()))
|
||||
}
|
||||
|
||||
pub fn push(&self, error: CompileError) {
|
||||
self.0.borrow_mut().push(error);
|
||||
self.0.borrow_mut().insert(error);
|
||||
}
|
||||
|
||||
pub fn extend(&self, errors: CompileErrors) {
|
||||
|
@ -23,7 +23,7 @@ impl SharedCompileErrors {
|
|||
}
|
||||
|
||||
pub fn take(&self) -> CompileErrors {
|
||||
self.0.borrow_mut().take_all().into()
|
||||
self.0.borrow_mut().take_all().to_vec().into()
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue