TypeshadeDiagnostic
인터페이스, 편집기 분류
Compiler diagnostic enriched with the source range and span that produced it.
import type { TypeshadeDiagnostic } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
interface TypeshadeDiagnostic { readonly message: string; readonly category: 'error' | 'warning' | 'message'; readonly code?: string; readonly fileName: string; readonly range: TypeshadeRange; readonly span: TypeshadeTextSpan;}설명
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.
인스턴스 속성
message읽기 전용stringHuman-readable diagnostic message.
category읽기 전용'error' | 'warning' | 'message'Diagnostic severity.
code선택 사항읽기 전용stringCompiler-specific diagnostic code, when the diagnostic carries one.
fileName읽기 전용stringName of the source file the diagnostic was raised against.
range읽기 전용TypeshadeRangeZero-based half-open range the diagnostic covers.
span읽기 전용TypeshadeTextSpanUTF-16 offset span the diagnostic covers, equivalent to
range.
소스
src/language-service.ts, 50행, 커밋 c66579bf 기준