Documentation
¶
Overview ¶
Package lsp talks to language servers for the agent's code intelligence (spec_parity_027 PAR-TOOL-03): definitions, references, hover, symbols and diagnostics, from servers started lazily per language.
Index ¶
- Variables
- type Diagnostic
- type Launcher
- type Location
- type Manager
- func (m *Manager) Close()
- func (m *Manager) Definition(ctx context.Context, path string, line, col int) ([]Location, error)
- func (m *Manager) Diagnostics(ctx context.Context, path string, wait time.Duration) ([]Diagnostic, error)
- func (m *Manager) For(ctx context.Context, path string) (*server, error)
- func (m *Manager) Hover(ctx context.Context, path string, line, col int) (string, error)
- func (m *Manager) References(ctx context.Context, path string, line, col int) ([]Location, error)
- func (m *Manager) Running(path string) bool
- func (m *Manager) Symbols(ctx context.Context, path, query string) ([]Symbol, error)
- type Process
- type Server
- type Symbol
Constants ¶
This section is empty.
Variables ¶
var ErrNoServer = errors.New("no language server for this kind of file")
ErrNoServer: no language server is configured for the file.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Line int `json:"line"`
Column int `json:"column"`
Severity string `json:"severity"`
Message string `json:"message"`
Source string `json:"source,omitempty"`
}
Diagnostic is a problem a server reports.
type Launcher ¶
Launcher starts a server's command in the workspace (the engine's runs it guarded, in the OS sandbox).
type Location ¶
type Location struct {
Path string `json:"path"`
Line int `json:"line"`
Column int `json:"column"`
Text string `json:"text,omitempty"`
}
Location is a place in a file, for people: the path (relative to the workspace when inside it), 1-based line and column, and the line.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager starts language servers as files need them, one per language, and keeps the files it asks about in sync with the disk.
func NewManager ¶
NewManager is a manager for the workspace root.
func (*Manager) Definition ¶
Definition is where the symbol at (line, col) of path is defined.
func (*Manager) Diagnostics ¶
func (m *Manager) Diagnostics(ctx context.Context, path string, wait time.Duration) ([]Diagnostic, error)
Diagnostics are the problems the server reports for path as it is on disk, waiting up to wait for them.
func (*Manager) References ¶
References are where the symbol at (line, col) of path is used.
type Process ¶
type Process interface {
Stdin() io.WriteCloser
Stdout() io.ReadCloser
Stop()
}
Process is a started language server: its stdin and stdout, and how to stop it.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package lsptest is a fake language server for tests: the test binary runs it when started with BLITZ_FAKE_LSP=1 (call MaybeServe first in TestMain), and Launcher starts that.
|
Package lsptest is a fake language server for tests: the test binary runs it when started with BLITZ_FAKE_LSP=1 (call MaybeServe first in TestMain), and Launcher starts that. |