Documentation
¶
Index ¶
- Variables
- func FormatIntSlice(values []int) string
- func FormatStringSlice(values []string) string
- func LoadRawConfig(path string) (map[string]any, bool)
- func LoadRawConfigForDir(dir string) (map[string]any, bool)
- func LoadRawConfigForWorkspace(args loader.WorkspaceFiles) (map[string]any, bool)
- func ParseBool(value string) (bool, error)
- func ParseIntSlice(value string) ([]int, error)
- func ParseNonNegInt(value string) (int, error)
- func ParsePositiveInt(value string) (int, error)
- func ParseStringLiteral(value string) (string, error)
- func ParseStringSlice(value string) ([]string, error)
- type AutoSave
- type AutoSaveAfterDelay
- type EditorConfig
- type Search
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidOption = errors.New("invalid option")
)
Functions ¶
func FormatIntSlice ¶
FormatIntSlice renders integers as a bracketed list
func FormatStringSlice ¶
FormatStringSlice renders strings as a bracketed list
func LoadRawConfig ¶
LoadRawConfig returns the raw merged TOML map for the given config file path
func LoadRawConfigForDir ¶
LoadRawConfigForDir returns user config merged with dir's trusted workspace config
func LoadRawConfigForWorkspace ¶
func LoadRawConfigForWorkspace( args loader.WorkspaceFiles, ) (map[string]any, bool)
LoadRawConfigForWorkspace merges the user and workspace config TOML
func ParseIntSlice ¶
ParseIntSlice parses a bracketed list of integers
func ParseNonNegInt ¶
ParseNonNegInt parses an option value that may be zero
func ParsePositiveInt ¶
ParsePositiveInt parses an option value that must exceed zero
func ParseStringLiteral ¶
ParseStringLiteral parses an optionally quoted string value
func ParseStringSlice ¶
ParseStringSlice parses a bracketed list of strings
Types ¶
type AutoSave ¶
type AutoSave struct {
FocusLost *bool `toml:"focus-lost"`
AfterDelay AutoSaveAfterDelay `toml:"after-delay"`
}
func (*AutoSave) UnmarshalTOML ¶
UnmarshalTOML accepts either a bool or a table of auto-save triggers
type AutoSaveAfterDelay ¶
type EditorConfig ¶
type EditorConfig struct {
IndentStyle *core.IndentStyle
TabWidth *int
LineEnding *core.LineEnding
TrimTrailingWhitespace *bool
InsertFinalNewline *bool
MaxLineLength *int
}
func FindEditorConfig ¶
func FindEditorConfig(file string) *EditorConfig
FindEditorConfig resolves the .editorconfig settings applying to file