lsp

package
v0.107.26 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityError   = 1
	SeverityWarning = 2
	SeverityInfo    = 3
	SeverityHint    = 4
)

Variables

View Source
var ErrNoServer = errors.New("no language server is configured for this file type")

ErrNoServer reports a file no configured language server handles.

Functions

func FromConfigMap

func FromConfigMap(in map[string]config.LSPServer) map[string]ServerSpec

func Report

func Report(edited string, editedDiags []Diagnostic, siblings map[string][]Diagnostic) string

Types

type Diagnostic

type Diagnostic struct {
	Line     int
	Col      int
	Severity int
	Message  string
}

type Location added in v0.107.13

type Location struct {
	Path string
	Line int
	Col  int
}

Location is a position in a file; Line and Col are 1-based.

type Manager

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

func NewManager

func NewManager(specs map[string]ServerSpec) *Manager

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Definition added in v0.107.13

func (m *Manager) Definition(ctx context.Context, path string, line, col int) ([]Location, error)

Definition returns where the symbol at path:line:col is defined.

func (*Manager) DocumentSymbols added in v0.107.13

func (m *Manager) DocumentSymbols(ctx context.Context, path string) ([]Symbol, error)

DocumentSymbols returns the outline of path.

func (*Manager) Hover added in v0.107.13

func (m *Manager) Hover(ctx context.Context, path string, line, col int) (string, error)

Hover returns the type information and documentation for the symbol at path:line:col.

func (*Manager) References added in v0.107.13

func (m *Manager) References(ctx context.Context, path string, line, col int) ([]Location, error)

References returns every usage of the symbol at path:line:col, its declaration included.

func (*Manager) Statuses

func (m *Manager) Statuses() []Status

func (*Manager) WaitDiagnostics

func (m *Manager) WaitDiagnostics(ctx context.Context, path string) string

func (*Manager) WorkspaceSymbols added in v0.107.13

func (m *Manager) WorkspaceSymbols(ctx context.Context, path, dir, query string) ([]Symbol, error)

WorkspaceSymbols searches symbols by name. path picks the language server (any file of the project); without it every running server whose root contains dir is asked.

type ServerSpec

type ServerSpec struct {
	Command     []string
	Extensions  []string
	RootMarkers []string
	Env         map[string]string
	Disabled    bool
}

type Status

type Status struct {
	Name  string
	Root  string
	State string
	Err   string
}

type Symbol added in v0.107.13

type Symbol struct {
	Name      string
	Kind      string
	Detail    string
	Container string
	Location
	Depth int
}

Symbol is one entry of a document or workspace symbol listing. Depth is the nesting level in a hierarchical document outline (0 at top level).

Jump to

Keyboard shortcuts

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