Skip to content

Commit

Permalink
Update name of diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Nov 1, 2023
1 parent 9d9d8dd commit c3529a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/symbols/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct RootSymbol<'a> {
parser: &'a CapturingModuleParser<'a>,
specifiers_to_ids: AdditiveOnlyMap<ModuleSpecifier, ModuleId>,
ids_to_symbols: AdditiveOnlyMap<ModuleId, ModuleSymbol>,
diagnostics: RefCell<Vec<TypeTraceDiagnostic>>,
diagnostics: RefCell<Vec<SymbolFillDiagnostic>>,
}

impl<'a> RootSymbol<'a> {
Expand Down Expand Up @@ -206,7 +206,7 @@ impl<'a> RootSymbol<'a> {
)
}

pub fn take_diagnostics(&self) -> Vec<TypeTraceDiagnostic> {
pub fn take_diagnostics(&self) -> Vec<SymbolFillDiagnostic> {
std::mem::take(&mut *self.diagnostics.borrow_mut())
}
}
Expand Down Expand Up @@ -877,21 +877,21 @@ impl EsmModuleSymbol {
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub enum TypeTraceDiagnosticKind {
pub enum SymbolFillDiagnosticKind {
UnsupportedDefaultExpr,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct TypeTraceDiagnostic {
pub kind: TypeTraceDiagnosticKind,
pub struct SymbolFillDiagnostic {
pub kind: SymbolFillDiagnosticKind,
pub specifier: ModuleSpecifier,
pub line_and_column: Option<LineAndColumnDisplay>,
}

struct SymbolFiller<'a> {
specifier: &'a ModuleSpecifier,
source: &'a ParsedSource,
diagnostics: Vec<TypeTraceDiagnostic>,
diagnostics: Vec<SymbolFillDiagnostic>,
}

impl<'a> SymbolFiller<'a> {
Expand Down Expand Up @@ -1588,8 +1588,8 @@ impl<'a> SymbolFiller<'a> {
.source
.text_info()
.line_and_column_display(default_export_range.start);
self.diagnostics.push(TypeTraceDiagnostic {
kind: TypeTraceDiagnosticKind::UnsupportedDefaultExpr,
self.diagnostics.push(SymbolFillDiagnostic {
kind: SymbolFillDiagnosticKind::UnsupportedDefaultExpr,
specifier: self.specifier.clone(),
line_and_column: Some(line_and_column),
});
Expand Down
4 changes: 2 additions & 2 deletions src/symbols/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub use self::analyzer::ModuleSymbolRef;
pub use self::analyzer::RootSymbol;
pub use self::analyzer::Symbol;
pub use self::analyzer::SymbolDecl;
pub use self::analyzer::SymbolFillDiagnostic;
pub use self::analyzer::SymbolFillDiagnosticKind;
pub use self::analyzer::SymbolId;
pub use self::analyzer::SymbolNodeRef;
pub use self::analyzer::TypeTraceDiagnostic;
pub use self::analyzer::TypeTraceDiagnosticKind;
pub use self::analyzer::UniqueSymbolId;
pub use self::cross_module::Definition;
pub use self::cross_module::DefinitionKind;
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/test_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ impl Loader for TestLoader {

#[cfg(feature = "symbols")]
pub mod symbols {
use deno_graph::symbols::TypeTraceDiagnostic;
use deno_graph::symbols::SymbolFillDiagnostic;

pub struct SymbolsResult {
pub output: String,
pub diagnostics: Vec<TypeTraceDiagnostic>,
pub diagnostics: Vec<SymbolFillDiagnostic>,
}
}

Expand Down

0 comments on commit c3529a4

Please sign in to comment.