Documentation
¶
Overview ¶
Package check runs the language server's diagnostic pipeline over files without an editor: the high-level boundary for non-LSP frontends. Config discovery belongs to the caller — Run takes resolved inputs — and so does presentation: results are data, printing is the CLI's job.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Line, Col int
EndLine, EndCol int
Severity Severity
Code string
Message string
}
Diagnostic is one finding in 1-based file coordinates with UTF-16 columns: ready to print, with no editor-protocol vocabulary.
type FixSummary ¶
type FixSummary struct {
// Applied is the number of fixes applied across all passes.
Applied int
// Files lists the fixed files' absolute paths.
Files []string
// Passes is the number of pipeline runs.
Passes int
// Skipped lists the fixes that could not apply.
Skipped []SkippedFix
}
FixSummary reports a fix run.
type Request ¶
type Request struct {
// Files are the absolute thrift paths to check.
Files []string
// Folder is the absolute resolution root. Empty derives from the
// first file's directory.
Folder string
// IncludePaths are the compiler-equivalent include roots, authoritative
// for the run.
IncludePaths []string
// Lint tunes the pipeline. Nil means defaults.
Lint *options.LintConfig
// Analyzers are appended to the built-in pipeline.
Analyzers []sema.Analyzer
// Fix rewrites files in place until nothing applies, preserving file
// permissions.
Fix bool
}
Request is one check run over materialized files.
type Result ¶
type Result struct {
Diagnostics map[string][]Diagnostic
Fix *FixSummary
}
Result is one check run. Diagnostics are keyed by absolute path. Without Fix they hold everything found; with Fix they hold what remains unfixed. Fix is nil unless Request.Fix.
type SkippedFix ¶
type SkippedFix struct {
// File is the absolute path of the file carrying the fix.
File string
// Title names the fix.
Title string
// Reason explains why it was skipped.
Reason string
}
SkippedFix is a fix that could not apply.