Documentation
¶
Index ¶
- Constants
- Variables
- func AnySlice(value any) ([]any, bool)
- func BoolPtr(value any) *bool
- func CacheDir() (string, bool)
- func CanonicalPath(path string) string
- func ConfigDir() (string, bool)
- func ConfigFile() (string, bool)
- func ConfigIgnoreFile() string
- func DataDir() (string, bool)
- func ExpandUserPath(path string) string
- func FindWorkspace(dir string) (string, bool)
- func IntPtr(value any) *int
- func LanguagesFile() (string, bool)
- func LoadDefaultLanguagesTOML() (map[string]any, bool)
- func LoadMergedTOML(paths []string, depth int) (map[string]any, bool)
- func LoadMergedTOMLWithBase(base map[string]any, paths []string, depth int) (map[string]any, bool)
- func LoadThemeTOML(name string) (map[string]any, error)
- func LogFile() (string, bool)
- func MergeTOMLValues(values Overlay[any], depth int) any
- func QueryWorkspaceTrust(dir string, insecure bool) bool
- func StringPtr(value any) *string
- func ThemeNames() []string
- func TrustWorkspace(dir string) error
- func UntrustWorkspace(dir string) error
- func WorkspaceConfigFile(dir string) string
- func WorkspaceInitFile(dir string) string
- func WorkspaceLanguagesFile(dir string) string
- func WorkspaceTrustFile() (string, bool)
- type Overlay
- type WorkspaceFiles
Constants ¶
const ( DirName = "toe" LogFileName = "toe.log" WorkspaceDirName = "." + DirName )
Variables ¶
var ( ErrThemeNotFound = errors.New("theme not found") ErrThemeCycle = errors.New("theme inheritance cycle") )
Functions ¶
func CanonicalPath ¶ added in v0.1.27
CanonicalPath resolves symlinks in path's parent directory and joins the unresolved final element
func ConfigIgnoreFile ¶
func ConfigIgnoreFile() string
ConfigIgnoreFile returns the user's picker ignore-file path
func ExpandUserPath ¶
ExpandUserPath expands leading home-directory shorthand and environment vars
func FindWorkspace ¶
FindWorkspace walks up for a .git or .toe directory. The bool reports a fallback to dir itself, not success
func LanguagesFile ¶
LanguagesFile returns the user's languages.toml path
func LoadDefaultLanguagesTOML ¶
LoadDefaultLanguagesTOML returns the cached bundled defaults; do not mutate
func LoadMergedTOML ¶
LoadMergedTOML overlays each readable path onto the previous ones
func LoadMergedTOMLWithBase ¶
func LoadMergedTOMLWithBase( base map[string]any, paths []string, depth int, ) (map[string]any, bool)
LoadMergedTOMLWithBase merges TOML files onto an already decoded base map
func LoadThemeTOML ¶
LoadThemeTOML reads an embedded theme, resolving its inherits chain
func MergeTOMLValues ¶
MergeTOMLValues overlays Over onto Base, merging maps only while depth remains; below that Over replaces Base outright
func QueryWorkspaceTrust ¶
QueryWorkspaceTrust reports whether dir's workspace may run its own config and init files; insecure trusts everything
func TrustWorkspace ¶
TrustWorkspace adds the workspace containing dir to the trusted list
func UntrustWorkspace ¶
UntrustWorkspace drops the workspace containing dir from the trusted list
func WorkspaceConfigFile ¶
WorkspaceConfigFile returns the workspace config.toml path under dir
func WorkspaceInitFile ¶ added in v0.1.31
WorkspaceInitFile returns the workspace Ale initialization path
func WorkspaceLanguagesFile ¶
WorkspaceLanguagesFile returns the workspace languages.toml path under dir
func WorkspaceTrustFile ¶
WorkspaceTrustFile returns the path of the trusted-workspace list
Types ¶
type Overlay ¶ added in v0.2.0
type Overlay[T any] struct { Base T Over T }
Overlay is a base value and the value layered on top of it
type WorkspaceFiles ¶ added in v0.2.0
WorkspaceFiles names a global settings file and the workspace file merged over it, alongside the directory whose trust governs that merge