Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecisiveSummary ¶
DecisiveSummary extracts the smallest useful failure signal from raw output.
Types ¶
type LanguageServerCheck ¶ added in v0.0.3
type LanguageServerCheck func(path string) (diagnostics []protocol.Diagnostic, checker string, unchecked string, handled bool)
LanguageServerCheck checks a file with its language server. It returns the diagnostics, the name of the server that produced them, why nothing checked the file when nothing did, and whether the file has a language at all. Supplied by the caller so this package does not depend on the code index.
type Result ¶ added in v0.0.3
type Result struct {
Diagnostics []protocol.Diagnostic
Checker string
Unchecked string
}
Result is one file's check: what was found, and what did the finding.
Checker and Unchecked exist because an empty diagnostic list is ambiguous. Thirteen new TypeScript files produced no diagnostics and no way to tell "nothing wrong" from "nothing looked". Exactly one of them is set for a file Jade knows the language of; both are empty for files with no language (Markdown, a Dockerfile), where "not checked" on every edit would be noise.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service normalizes parser, LSP, and lint diagnostics.
func NewService ¶
func (*Service) Check ¶ added in v0.0.3
Check runs the synchronous checks for the file named by scope.
Results are memoised per file on modification time and size. Edit responses ask for diagnostics and for the checker name separately, and running gopls or waiting on a language server twice for one unchanged file would double the latency of every edit.
func (*Service) Checks ¶ added in v0.0.3
func (s *Service) Checks(scopes ...string) protocol.CheckReport
Checks reports which checkers ran on the files in scopes, and which files went unchecked and why, for an edit response.
func (*Service) Immediate ¶
func (s *Service) Immediate(scope string) []protocol.Diagnostic
Immediate runs the fast, synchronous checks that fit within an edit's latency budget and returns their diagnostics. Check has the same result with the name of the checker that produced it.
func (*Service) UseLanguageServers ¶ added in v0.0.3
func (s *Service) UseLanguageServers(check LanguageServerCheck)
UseLanguageServers enables language-server diagnostics for every language with a configured server.