TsCompilerDiagnostic
인터페이스, 작성 분류
A source diagnostic produced while TypeShade analyzes or compiles TypeScript shader code.
import type { TsCompilerDiagnostic } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
interface TsCompilerDiagnostic { readonly message: string; readonly fileName: string; readonly line: number; readonly character: number; readonly category: 'error' | 'warning' | 'message'; readonly code?: string; readonly start: number; readonly length: number; readonly endLine: number; readonly endCharacter: number;}설명
line/character are one-based (external consumers, including language-service.ts, read
these) and mark the start of the offending node. start/length are UTF-16 offsets into the
file — node.getStart(sourceFile) and node.getEnd() - node.getStart(sourceFile) — so an
editor can underline the whole node rather than a single character; endLine/endCharacter
are the one-based position of start + length, in the same convention as line/character.
A diagnostic with no node behind it (a missing directive, a whole-module backend failure) uses
the file’s first statement as its span, or start: 0, length: 0 when the file has none — see
makeDiagnostic in diagnostic.ts.
인스턴스 속성
message읽기 전용stringfileName읽기 전용stringline읽기 전용numbercharacter읽기 전용numbercategory읽기 전용'error' | 'warning' | 'message'code선택 사항읽기 전용stringstart읽기 전용numberUTF-16 offset where the diagnostic’s span begins.
length읽기 전용numberLength of the diagnostic’s span, in UTF-16 code units.
endLine읽기 전용numberOne-based line of the position
start + length.endCharacter읽기 전용numberOne-based character of the position
start + length.
소스
src/compiler/ts/source-file.ts, 121행, 커밋 c66579bf 기준