Documentation
¶
Index ¶
- func DefaultServerConfigs() map[string]ServerConfig
- type Manager
- func (m *Manager) CloseFile(ctx context.Context, filePath string) error
- func (m *Manager) GetAllServers() map[string]*ServerInstance
- func (m *Manager) GetAvailableServers() []string
- func (m *Manager) GetServerForFile(filePath string) *ServerInstance
- func (m *Manager) GetStatus() map[string]ServerState
- func (m *Manager) Initialize(ctx context.Context) error
- func (m *Manager) InitializeForFile(ctx context.Context, filePath string) (*ServerInstance, error)
- func (m *Manager) InitializeServer(ctx context.Context, serverName string) (*ServerInstance, error)
- func (m *Manager) IsFileOpen(filePath string) bool
- func (m *Manager) OpenFile(ctx context.Context, filePath string) error
- func (m *Manager) SendRequest(ctx context.Context, filePath string, method string, params interface{}) (interface{}, error)
- func (m *Manager) SetConfigs(configs map[string]ServerConfig)
- func (m *Manager) Shutdown(ctx context.Context) error
- type ServerConfig
- type ServerInstance
- type ServerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultServerConfigs ¶
func DefaultServerConfigs() map[string]ServerConfig
DefaultServerConfigs returns default LSP server configurations
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages multiple LSP server instances
func NewManager ¶
NewManager creates a new LSP server manager
func (*Manager) GetAllServers ¶
func (m *Manager) GetAllServers() map[string]*ServerInstance
GetAllServers returns all running servers
func (*Manager) GetAvailableServers ¶
GetAvailableServers returns a list of available server names
func (*Manager) GetServerForFile ¶
func (m *Manager) GetServerForFile(filePath string) *ServerInstance
GetServerForFile returns the server for a given file
func (*Manager) GetStatus ¶
func (m *Manager) GetStatus() map[string]ServerState
GetStatus returns the status of all servers
func (*Manager) Initialize ¶
Initialize initializes all configured LSP servers
func (*Manager) InitializeForFile ¶
InitializeForFile initializes the appropriate LSP server for a file
func (*Manager) InitializeServer ¶
InitializeServer initializes a specific LSP server
func (*Manager) IsFileOpen ¶
IsFileOpen checks if a file is open in any LSP server
func (*Manager) SendRequest ¶
func (m *Manager) SendRequest(ctx context.Context, filePath string, method string, params interface{}) (interface{}, error)
SendRequest sends a request to the appropriate LSP server for a file
func (*Manager) SetConfigs ¶
func (m *Manager) SetConfigs(configs map[string]ServerConfig)
SetConfigs sets custom server configurations
type ServerConfig ¶
type ServerConfig struct {
// Command is the command to start the LSP server
Command string
// Args are the command-line arguments
Args []string
// Env is the environment variables
Env []string
// RootPatterns are the root marker patterns
RootPatterns []string
// ExtensionToLanguage maps file extensions to language IDs
ExtensionToLanguage map[string]string
// Languages is the list of languages this server supports
Languages []string
// Timeout is the initialization timeout
Timeout time.Duration
}
ServerConfig represents LSP server configuration
type ServerInstance ¶
type ServerInstance struct {
Name string
Config ServerConfig
Client *lspClient.Client
State ServerState
// contains filtered or unexported fields
}
ServerInstance represents a running LSP server instance
type ServerState ¶
type ServerState string
ServerState represents the state of a server
const ( ServerStateStopped ServerState = "stopped" ServerStateStarting ServerState = "starting" ServerStateRunning ServerState = "running" ServerStateError ServerState = "error" ServerStateStopping ServerState = "stopping" )