diagnostics.ts

Diagnostic types for CSS class extraction and generation.

Provides a unified diagnostic system across all phases: - Extraction: Parsing source files to find class names - Generation: Producing CSS output from class definitions

Declarations
#

9 declarations

view source

BaseDiagnostic
#

diagnostics.ts view source

BaseDiagnostic

Base diagnostic with common fields.

level

type 'error' | 'warning'

message

type string

suggestion

type string | null

create_generation_diagnostic
#

diagnostics.ts view source

(diagnostic: InterpreterDiagnostic, locations: SourceLocation[] | null): GenerationDiagnostic

Converts a InterpreterDiagnostic to a GenerationDiagnostic with locations.

diagnostic

- Interpreter diagnostic to convert

locations

- Source locations where the class was used

type SourceLocation[] | null

returns

GenerationDiagnostic

CssGenerationError
#

diagnostics.ts view source

Error thrown when CSS generation encounters errors or warnings (depending on on_error and on_warning settings). Contains the full diagnostics array for programmatic access.

inheritance

extends:
  • Error

diagnostics

type Array<Diagnostic>

constructor

type new (diagnostics: Diagnostic[]): CssGenerationError

diagnostics
type Diagnostic[]

Diagnostic
#

ExtractionDiagnostic
#

format_diagnostic
#

GenerationDiagnostic
#

diagnostics.ts view source

GenerationDiagnostic

Diagnostic from the generation phase.

phase

type 'generation'

level

type 'error' | 'warning'

message

type string

suggestion

type string | null

class_name

type string

locations

Source locations where this class was used, or null if from include_classes

type Array<SourceLocation> | null

InterpreterDiagnostic
#

diagnostics.ts view source

InterpreterDiagnostic

Diagnostic from CSS class interpretation. Used internally by interpreters; converted to GenerationDiagnostic with locations.

level

type 'error' | 'warning'

message

type string

class_name

type string

suggestion

type string | null

SourceLocation
#

diagnostics.ts view source

SourceLocation

Source location for IDE/LSP integration.

file

type string

line

1-based line number

type number

column

1-based column number

type number

Imported by
#