Documentation
¶
Overview ¶
Package langregistry provides an embedded language server registry with 40+ entries and YAML override support. It is the data layer consumed by the LS pool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlatformKey ¶
func PlatformKey() string
PlatformKey returns the current platform key for binary downloads (e.g. "darwin-arm64").
Types ¶
type InstallInfo ¶
type InstallInfo struct {
// Type is the installer type: "npm", "pip", "binary", "cargo", "gem", "dotnet", "system".
Type string
// Package is the package name (e.g. "pyright", "bash-language-server").
Package string
// Version is the pinned version string.
Version string
// URLs maps platform keys (e.g. "darwin-arm64") to download URLs for binary installs.
URLs map[string]string
// SHA256 maps platform keys to expected checksums for binary installs.
SHA256 map[string]string
}
InstallInfo describes how to install a language server when it is not found in PATH.
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer resolves language server binaries using a three-tier strategy: 1. PATH lookup 2. Managed download (if AutoInstall and InstallInfo present) 3. Helpful error message
func NewInstaller ¶
func NewInstaller(cfg InstallerConfig, logger *slog.Logger) *Installer
NewInstaller creates an Installer with the given configuration.
type InstallerConfig ¶
type InstallerConfig struct {
// AutoInstall enables managed download when a binary is not found in PATH.
// Default: true.
AutoInstall bool
// BinDir is the directory for managed installs (default ~/.helix/bin/).
BinDir string
}
InstallerConfig controls the three-tier LS resolution behavior.
type LSEntry ¶
type LSEntry struct {
// Language is the canonical language key (e.g. "go", "python").
Language string
// Command is the LS binary name (e.g. "gopls", "pyright-langserver").
Command string
// Args are the command-line arguments for the LS binary.
Args []string
// InitOptions are passed as initializationOptions in the LSP initialize request.
InitOptions map[string]any
// NeedsWorkspace indicates whether the LS requires workspace folders.
NeedsWorkspace bool
// FileExts lists file extensions associated with this language (e.g. [".go"]).
FileExts []string
// Install holds managed-install metadata. nil means system-only.
Install *InstallInfo
// IgnoredDirs lists directories to skip for this language.
IgnoredDirs []string
}
LSEntry describes a language server binary, its arguments, file associations, and optional managed-install metadata.
func (LSEntry) InstallHint ¶
InstallHint returns a human-readable install instruction for this entry.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all language server entries with thread-safe access. It starts with compiled-in defaults and layers YAML overrides on top.
func NewRegistry ¶
NewRegistry creates a Registry pre-loaded with defaultEntries and applies YAML overrides from the given file paths (in order, later overrides win). Override files that do not exist are silently skipped.
func (*Registry) ByExtension ¶
ByExtension returns all entries whose FileExts contain the given extension. The extension should include the dot (e.g. ".py").