Documentation
¶
Overview ¶
Package providers chooses the analyzers a run invokes: the entries of the provider list that claim a language in scope, each with the executable its command resolves to. A command is resolved on the local filesystem alone and is never fetched, so an entry whose command resolves to nothing is refused rather than acquired.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRelativeCommand = errors.New("a command is a name looked up on PATH or an absolute path")
ErrRelativeCommand reports a command that is a path but not an absolute one, which is neither of the two forms a command takes.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
// Executable is the file the entry's command resolves to, which the run
// executes in place of the command as written.
Executable string
Entry config.Provider
}
Analyzer is one provider entry a run invokes.
func Select ¶
Select returns the analyzers a run over the languages in scope invokes, in the order of entries: every entry claiming at least one of them, two entries claiming one language included, and no other.
A language in scope that no entry claims is a *config.Error naming every such language, reported before any command is resolved. Otherwise an entry whose command resolves to no executable is a *CommandError, one joined per such entry in the order of entries.
type CommandError ¶
type CommandError struct {
// Err is why: an [*exec.Error] from the lookup, or [ErrRelativeCommand].
Err error
Name string // the entry's analyzer name
Index int // the entry's place in the provider list
}
CommandError is a provider entry the run invokes whose command resolves to no executable file.
func (*CommandError) Error ¶
func (e *CommandError) Error() string
Error names the analyzer and the provider entry.
func (*CommandError) Unwrap ¶
func (e *CommandError) Unwrap() error
Unwrap is why the command resolves to nothing.