workspaces

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	WorktreeCacheCap = 512
)

Variables

This section is empty.

Functions

func CachedWorktrees

func CachedWorktrees() int

CachedWorktrees counts the worktree resolutions held in the cache

func ClearWorkspaceCache

func ClearWorkspaceCache()

ClearWorkspaceCache forgets every cached worktree resolution

func FindGitWorktree

func FindGitWorktree(start string) string

FindGitWorktree returns the nearest ancestor holding a .git file or directory, empty when none

func IsInsideWorkspace

func IsInsideWorkspace(path, workspaceRoot string) bool

IsInsideWorkspace reports whether a path is the workspace root or lies under it, symlinks unresolved

func IsTrustedWorkspace

func IsTrustedWorkspace(root string, trustedRoots []string, operatorRoots map[string]bool) bool

IsTrustedWorkspace reports whether a root lies in a trusted directory or belongs to an operator worktree

func NearestRoot

func NearestRoot(start string, markers, excludes []string, ceiling string) string

NearestRoot walks up for the first directory holding a marker, empty past the ceiling or after an exclude hit

func NormalizePath

func NormalizePath(path string) string

NormalizePath expands a leading tilde and makes the path absolute and clean without resolving symlinks

func OperatorWorkspaceRoots

func OperatorWorkspaceRoots(anchors []func() (string, error)) map[string]bool

OperatorWorkspaceRoots maps each anchor to its git worktree, skipping failed anchors and repos at or above home

func PathList

func PathList(v any) ([]string, bool)

PathList reads a config list of paths with the tilde expanded, false when not a list of strings

func ResolveWorkspaceForFile

func ResolveWorkspaceForFile(filePath, cwd string) (string, bool)

ResolveWorkspaceForFile picks the cwd worktree when the file lies in it, else the file's own worktree

func TrustedWorkspaces

func TrustedWorkspaces(value any) ([]string, bool)

TrustedWorkspaces reads lsp.trusted_workspaces as directories, false when the value is malformed

Types

This section is empty.

Jump to

Keyboard shortcuts

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