API reference / @jsprismarine/packs / DiagnosticCollector
Class: DiagnosticCollector
Defined in: packages/packs/src/diagnostics.ts:35
Collects diagnostics for one load, collapsing repeats so a pack-wide pattern, such as an unknown component name in every file of a pack, is one line of the report rather than thousands.
The collapsing key is the pack, the code and the message, and path stays out of it on purpose: a per-file code would otherwise defeat the collapsing, and the file is what repeats. So that a collapsed diagnostic still leads to the files, it carries occurrences and the first few paths, which is the information a reader needs without making the report length grow with the pack.
Constructors
Constructor
new DiagnosticCollector():
DiagnosticCollector
Returns
DiagnosticCollector
Accessors
diagnostics
Get Signature
get diagnostics(): readonly
Diagnostic[]
Defined in: packages/packs/src/diagnostics.ts:60
The diagnostics reported so far, in report order.
Returns
readonly Diagnostic[]
Methods
add()
add(
diagnostic):void
Defined in: packages/packs/src/diagnostics.ts:44
Adds a diagnostic. A repeat of a pack, code and message already reported collapses into the first one, raising its occurrences and listing its file.
Parameters
diagnostic
Returns
void