config

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOption = errors.New("invalid option")
)

Functions

func FormatIntSlice

func FormatIntSlice(values []int) string

func FormatStringSlice

func FormatStringSlice(values []string) string

func LoadRawConfig

func LoadRawConfig(path string) (map[string]any, bool)

LoadRawConfig returns the raw merged TOML map for the given config file path

func LoadRawConfigForDir

func LoadRawConfigForDir(dir string) (map[string]any, bool)

LoadRawConfigForDir returns user config merged with dir's trusted workspace config

func LoadRawConfigForWorkspace

func LoadRawConfigForWorkspace(
	global, workspace, dir string,
) (map[string]any, bool)

func ParseBool

func ParseBool(value string) (bool, error)

func ParseIntSlice

func ParseIntSlice(value string) ([]int, error)

func ParseNonNegInt

func ParseNonNegInt(value string) (int, error)

func ParsePositiveInt

func ParsePositiveInt(value string) (int, error)

func ParseStringLiteral

func ParseStringLiteral(value string) (string, error)

func ParseStringSlice

func ParseStringSlice(value string) ([]string, error)

Types

type AutoSave

type AutoSave struct {
	FocusLost  *bool              `toml:"focus-lost"`
	AfterDelay AutoSaveAfterDelay `toml:"after-delay"`
}

func (*AutoSave) UnmarshalTOML

func (a *AutoSave) UnmarshalTOML(value any) error

type AutoSaveAfterDelay

type AutoSaveAfterDelay struct {
	Enable  *bool `toml:"enable"`
	Timeout *int  `toml:"timeout"`
}

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
type Search struct {
	SmartCase  *bool `toml:"smart-case"`
	WrapAround *bool `toml:"wrap-around"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL