Documentation
¶
Overview ¶
Formatter service
Built-in formatter registry
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
type Configuration ¶
type Configuration struct {
// Enabled=false (no formatter config) disables every formatter.
Enabled bool
Overrides []FormatterOverride
}
type Dependencies ¶
type Dependencies struct {
Which func(string) (string, bool)
NpmWhich func(context.Context, string) (string, bool)
ExperimentalOxfmt bool
}
Dependencies isolates PATH, npm, filesystem, flags, and process probes.
type FormatterOverride ¶
type Info ¶
type Info struct {
Key string
Name string
Environment map[string]string
Extensions []string
Enabled EnabledFunc
}
func Builtins ¶
func Builtins(dependencies Dependencies) []Info
Builtins returns the built-in formatters. Every entry's Key, which is what a config override names, is also its Name, which is what it registers under, so an override reaches the formatter it names. The order is the order a file's candidates are collected in.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(instance Context, configuration Configuration, dependencies Dependencies, runner CommandRunner) *Service
Click to show internal directories.
Click to hide internal directories.