config

package
v0.0.0-...-f58d88c Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config represents configuration management for language servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers map[string]*ServerConfig `mapstructure:"servers"`
}

Config represents the overall configuration.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages configuration loading and access.

func NewManager

func NewManager() *Manager

NewManager creates a new configuration manager.

func (*Manager) AddServer

func (m *Manager) AddServer(name string, config *ServerConfig)

AddServer adds or updates a server configuration.

func (*Manager) GetServer

func (m *Manager) GetServer(name string) (*ServerConfig, bool)

GetServer returns a specific server configuration.

func (*Manager) GetServers

func (m *Manager) GetServers() map[string]*ServerConfig

GetServers returns all server configurations.

func (*Manager) LoadDefaults

func (m *Manager) LoadDefaults()

LoadDefaults loads default server configurations.

func (*Manager) LoadFromMap

func (m *Manager) LoadFromMap(data map[string]any) error

LoadFromMap loads configuration from a map (useful for testing).

func (*Manager) RemoveServer

func (m *Manager) RemoveServer(name string)

RemoveServer removes a server configuration.

type ServerConfig

type ServerConfig struct {
	Command           string            `mapstructure:"command"`
	Args              []string          `mapstructure:"args"`
	FileTypes         []string          `mapstructure:"filetypes"`
	RootMarkers       []string          `mapstructure:"root_markers"`
	Environment       map[string]string `mapstructure:"environment"`
	Settings          map[string]any    `mapstructure:"settings"`
	InitOptions       map[string]any    `mapstructure:"init_options"`
	EnableSnippets    bool              `mapstructure:"enable_snippets"`
	SingleFileSupport bool              `mapstructure:"single_file_support"`
}

ServerConfig represents the configuration for a language server.

Jump to

Keyboard shortcuts

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