Documentation
¶
Index ¶
- Variables
- func CompareASTDiagnostics(a, b *ASTDiagnostic) int
- func FlattenDiagnosticMessage(d Diagnostic, newLine string) string
- func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic, formatOpts *FormattingOptions)
- func FormatDiagnosticsStatusAndTime(output io.Writer, time string, diag Diagnostic, formatOpts *FormattingOptions)
- func FormatDiagnosticsStatusWithColorAndTime(output io.Writer, time string, diag Diagnostic, formatOpts *FormattingOptions)
- func FormatDiagnosticsWithColorAndContext(output io.Writer, diags []Diagnostic, formatOpts *FormattingOptions)
- func TryClearScreen(output io.Writer, diag Diagnostic, options *core.CompilerOptions) bool
- func WriteErrorSummaryText(output io.Writer, allDiagnostics []Diagnostic, formatOpts *FormattingOptions)
- func WriteFlattenedASTDiagnosticMessage(writer io.Writer, diagnostic *ast.Diagnostic, newline string)
- func WriteFlattenedDiagnosticMessage(writer io.Writer, diagnostic Diagnostic, newline string)
- func WriteFormatDiagnostic(output io.Writer, diagnostic Diagnostic, formatOpts *FormattingOptions)
- func WriteFormatDiagnostics(output io.Writer, diagnostics []Diagnostic, formatOpts *FormattingOptions)
- func WriteLocation(output io.Writer, file FileLike, pos int, formatOpts *FormattingOptions, ...)
- type ASTDiagnostic
- type Diagnostic
- type ErrorSummary
- type FileLike
- type FormattedWriter
- type FormattingOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ScreenStartingCodes = []int32{ diagnostics.Starting_compilation_in_watch_mode.Code(), diagnostics.File_change_detected_Starting_incremental_compilation.Code(), }
Functions ¶
func CompareASTDiagnostics ¶
func CompareASTDiagnostics(a, b *ASTDiagnostic) int
func FlattenDiagnosticMessage ¶
func FlattenDiagnosticMessage(d Diagnostic, newLine string) string
func FormatDiagnosticWithColorAndContext ¶
func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic, formatOpts *FormattingOptions)
func FormatDiagnosticsStatusAndTime ¶
func FormatDiagnosticsStatusAndTime(output io.Writer, time string, diag Diagnostic, formatOpts *FormattingOptions)
func FormatDiagnosticsStatusWithColorAndTime ¶
func FormatDiagnosticsStatusWithColorAndTime(output io.Writer, time string, diag Diagnostic, formatOpts *FormattingOptions)
func FormatDiagnosticsWithColorAndContext ¶
func FormatDiagnosticsWithColorAndContext(output io.Writer, diags []Diagnostic, formatOpts *FormattingOptions)
func TryClearScreen ¶
func TryClearScreen(output io.Writer, diag Diagnostic, options *core.CompilerOptions) bool
func WriteErrorSummaryText ¶
func WriteErrorSummaryText(output io.Writer, allDiagnostics []Diagnostic, formatOpts *FormattingOptions)
func WriteFlattenedASTDiagnosticMessage ¶
func WriteFlattenedASTDiagnosticMessage(writer io.Writer, diagnostic *ast.Diagnostic, newline string)
func WriteFlattenedDiagnosticMessage ¶
func WriteFlattenedDiagnosticMessage(writer io.Writer, diagnostic Diagnostic, newline string)
func WriteFormatDiagnostic ¶
func WriteFormatDiagnostic(output io.Writer, diagnostic Diagnostic, formatOpts *FormattingOptions)
func WriteFormatDiagnostics ¶
func WriteFormatDiagnostics(output io.Writer, diagnostics []Diagnostic, formatOpts *FormattingOptions)
func WriteLocation ¶
func WriteLocation(output io.Writer, file FileLike, pos int, formatOpts *FormattingOptions, writeWithStyleAndReset FormattedWriter)
Types ¶
type ASTDiagnostic ¶
type ASTDiagnostic struct {
*ast.Diagnostic
}
ASTDiagnostic wraps ast.Diagnostic to implement the Diagnostic interface
func WrapASTDiagnostic ¶
func WrapASTDiagnostic(d *ast.Diagnostic) *ASTDiagnostic
func WrapASTDiagnostics ¶
func WrapASTDiagnostics(diags []*ast.Diagnostic) []*ASTDiagnostic
func (*ASTDiagnostic) File ¶
func (d *ASTDiagnostic) File() FileLike
func (*ASTDiagnostic) MessageChain ¶
func (d *ASTDiagnostic) MessageChain() []Diagnostic
func (*ASTDiagnostic) RelatedInformation ¶
func (d *ASTDiagnostic) RelatedInformation() []Diagnostic
type Diagnostic ¶
type Diagnostic interface {
File() FileLike
Pos() int
End() int
Len() int
Code() int32
Category() diagnostics.Category
Message() string
MessageChain() []Diagnostic
RelatedInformation() []Diagnostic
}
Diagnostic interface abstracts over ast.Diagnostic and LSP diagnostics
func FromASTDiagnostics ¶
func FromASTDiagnostics(diags []*ast.Diagnostic) []Diagnostic
func ToDiagnostics ¶
func ToDiagnostics[T Diagnostic](diags []T) []Diagnostic
type ErrorSummary ¶
type ErrorSummary struct {
TotalErrorCount int
GlobalErrors []Diagnostic
ErrorsByFile map[FileLike][]Diagnostic
SortedFiles []FileLike
}
type FormattingOptions ¶
type FormattingOptions struct {
tspath.ComparePathsOptions
NewLine string
}
Click to show internal directories.
Click to hide internal directories.