TypeshadeDiagnostic
Interface in Editor
Compiler diagnostic enriched with the source range and span that produced it.
import type { TypeshadeDiagnostic } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface TypeshadeDiagnostic { readonly message: string; readonly category: 'error' | 'warning' | 'message'; readonly code?: string; readonly fileName: string; readonly range: TypeshadeRange; readonly span: TypeshadeTextSpan;}Description
span/range come directly from the compiler’s own start/length (see
TsCompilerDiagnostic in src/compiler/ts/source-file.ts), which already cover the
offending node — node.getStart(sourceFile) through node.getEnd() — or the file’s first
statement when the diagnostic has no node behind it. Nothing here recomputes a
one-character span from line/character any more.
Instance properties
messageread onlystringHuman-readable diagnostic message.
categoryread only'error' | 'warning' | 'message'Diagnostic severity.
codeoptionalread onlystringCompiler-specific diagnostic code, when the diagnostic carries one.
fileNameread onlystringName of the source file the diagnostic was raised against.
rangeread onlyTypeshadeRangeZero-based half-open range the diagnostic covers.
spanread onlyTypeshadeTextSpanUTF-16 offset span the diagnostic covers, equivalent to
range.
Source
src/language-service.ts, line 50, at commit 26de7be8