Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultClientCapabilities() protocol.ClientCapabilities
- func NewInitializeParams(cfg InitializeConfig) *protocol.InitializeParams
- func OffsetEncoding(capabilities protocol.ServerCapabilities) protocol.PositionEncodingKind
- func ResolveWorkspace(req WorkspaceRequest) (string, bool)
- func RootFound(root string, patterns []string) (bool, error)
- func SupportsFeature(capabilities protocol.ServerCapabilities, feature Feature) bool
- type Client
- func (c *Client) Capabilities() (protocol.ServerCapabilities, bool)
- func (c *Client) Close() error
- func (c *Client) CodeActions(ctx context.Context, doc DocumentSnapshot, r core.Range, ...) ([]protocol.CommandOrCodeAction, bool, error)
- func (c *Client) Completion(ctx context.Context, doc DocumentSnapshot, pos int, ...) (CompletionList, bool, error)
- func (c *Client) DidChange(ctx context.Context, doc DocumentSnapshot) (bool, error)
- func (c *Client) DidChangeDocument(ctx context.Context, doc DocumentSnapshot, change view.DocumentChange) (bool, error)
- func (c *Client) DidChangeWatchedFile(ctx context.Context, path string) error
- func (c *Client) DidChangeWatchedFiles(ctx context.Context, events []fileWatchEvent) error
- func (c *Client) DidClose(ctx context.Context, doc DocumentSnapshot) (bool, error)
- func (c *Client) DidCreateFile(ctx context.Context, path string, dir bool) (bool, error)
- func (c *Client) DidDeleteFile(ctx context.Context, path string, dir bool) (bool, error)
- func (c *Client) DidOpen(ctx context.Context, doc DocumentSnapshot) (bool, error)
- func (c *Client) DidRenameFile(ctx context.Context, rename view.FileRename, dir bool) (bool, error)
- func (c *Client) DidSave(ctx context.Context, doc DocumentSnapshot) (bool, error)
- func (c *Client) DocumentColors(ctx context.Context, doc DocumentSnapshot) ([]protocol.ColorInformation, bool, error)
- func (c *Client) DocumentDiagnostics(ctx context.Context, doc DocumentSnapshot, previousID *string) (protocol.DocumentDiagnosticReport, bool, error)
- func (c *Client) DocumentHighlights(ctx context.Context, doc DocumentSnapshot, pos int) ([]protocol.DocumentHighlight, bool, error)
- func (c *Client) DocumentLinks(ctx context.Context, doc DocumentSnapshot) ([]protocol.DocumentLink, bool, error)
- func (c *Client) DocumentSymbols(ctx context.Context, doc DocumentSnapshot) (protocol.DocumentSymbolResult, bool, error)
- func (c *Client) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) error
- func (c *Client) FormatDocument(ctx context.Context, doc DocumentSnapshot, opts protocol.FormattingOptions) ([]protocol.TextEdit, bool, error)
- func (c *Client) FormatRange(ctx context.Context, doc DocumentSnapshot, r core.Range, ...) ([]protocol.TextEdit, bool, error)
- func (c *Client) GotoDeclaration(ctx context.Context, doc DocumentSnapshot, pos int) ([]protocol.Location, bool, error)
- func (c *Client) GotoDefinition(ctx context.Context, doc DocumentSnapshot, pos int) ([]protocol.Location, bool, error)
- func (c *Client) GotoImplementation(ctx context.Context, doc DocumentSnapshot, pos int) ([]protocol.Location, bool, error)
- func (c *Client) GotoReference(ctx context.Context, doc DocumentSnapshot, pos int) ([]protocol.Location, bool, error)
- func (c *Client) GotoTypeDefinition(ctx context.Context, doc DocumentSnapshot, pos int) ([]protocol.Location, bool, error)
- func (c *Client) Hover(ctx context.Context, doc DocumentSnapshot, pos int) (*protocol.Hover, bool, error)
- func (c *Client) Initialize(ctx context.Context, params *protocol.InitializeParams) (*protocol.InitializeResult, error)
- func (c *Client) InlayHints(ctx context.Context, doc DocumentSnapshot, r core.Range) ([]protocol.InlayHint, bool, error)
- func (c *Client) Name() string
- func (c *Client) OffsetEncoding() protocol.PositionEncodingKind
- func (c *Client) PrepareRename(ctx context.Context, doc DocumentSnapshot, pos int) (protocol.PrepareRenameResult, bool, error)
- func (c *Client) RenameSymbol(ctx context.Context, doc DocumentSnapshot, pos int, name string) (*protocol.WorkspaceEdit, bool, error)
- func (c *Client) ResolveDocumentLink(ctx context.Context, link protocol.DocumentLink) (*protocol.DocumentLink, bool, error)
- func (c *Client) Server() protocol.Server
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) SignatureHelp(ctx context.Context, doc DocumentSnapshot, pos int, ...) (*protocol.SignatureHelp, bool, error)
- func (c *Client) State() ClientState
- func (c *Client) SupportsFeature(feature Feature) bool
- func (c *Client) WillCreateFile(ctx context.Context, path string, dir bool) (*protocol.WorkspaceEdit, bool, error)
- func (c *Client) WillDeleteFile(ctx context.Context, path string, dir bool) (*protocol.WorkspaceEdit, bool, error)
- func (c *Client) WillRenameFile(ctx context.Context, rename view.FileRename, dir bool) (*protocol.WorkspaceEdit, bool, error)
- func (c *Client) WorkspaceSymbols(ctx context.Context, query string) (protocol.WorkspaceSymbolResult, bool, error)
- type ClientState
- type CompletionList
- type DocumentSnapshot
- type Feature
- type InitializeConfig
- type Registry
- type RegistryStartArgs
- type Session
- func (s *Session) ApplyCodeAction(_ *view.Document, _ view.Id, item view.CodeAction) error
- func (s *Session) ApplyCompletion(doc *view.Document, viewID view.Id, item *view.CompletionItem) error
- func (s *Session) ApplyWorkspaceEdit(server string, edit protocol.WorkspaceEdit) error
- func (s *Session) Busy() bool
- func (s *Session) Close() error
- func (s *Session) CodeActions(doc *view.Document, viewID view.Id) ([]view.CodeAction, error)
- func (s *Session) Completions(doc *view.Document, viewID view.Id) (view.CompletionResult, error)
- func (s *Session) DidCreateFile(path string, dir bool) error
- func (s *Session) DidDeleteFile(path string, dir bool) error
- func (s *Session) DidRenameFile(rename view.FileRename, dir bool) error
- func (s *Session) DocumentChanged(doc *view.Document, change view.DocumentChange)
- func (s *Session) DocumentClosed(doc *view.Document)
- func (s *Session) DocumentColors(doc *view.Document) ([]view.DocumentColor, error)
- func (s *Session) DocumentHighlights(doc *view.Document, viewID view.Id) ([]view.DocumentHighlight, error)
- func (s *Session) DocumentLinks(doc *view.Document) ([]view.DocumentLink, error)
- func (s *Session) DocumentOpened(doc *view.Document)
- func (s *Session) DocumentSaved(doc *view.Document)
- func (s *Session) DocumentSymbols(doc *view.Document) ([]view.Symbol, error)
- func (s *Session) ExecuteWorkspaceCommand(doc *view.Document, name string, args []string) error
- func (s *Session) FormatDocument(doc *view.Document, _ view.Id) error
- func (s *Session) FormatSelection(doc *view.Document, viewID view.Id) error
- func (s *Session) GotoDeclaration(doc *view.Document, viewID view.Id) ([]view.Location, error)
- func (s *Session) GotoDefinition(doc *view.Document, viewID view.Id) ([]view.Location, error)
- func (s *Session) GotoImplementation(doc *view.Document, viewID view.Id) ([]view.Location, error)
- func (s *Session) GotoReference(doc *view.Document, viewID view.Id) ([]view.Location, error)
- func (s *Session) GotoTypeDefinition(doc *view.Document, viewID view.Id) ([]view.Location, error)
- func (s *Session) Hover(doc *view.Document, viewID view.Id) (string, error)
- func (s *Session) InlayHints(doc *view.Document, viewID view.Id) ([]view.InlayHint, error)
- func (s *Session) LanguageServerNames(doc *view.Document) []string
- func (s *Session) PublishDiagnostics(_ context.Context, params *protocol.PublishDiagnosticsParams) error
- func (s *Session) PullDiagnostics(doc *view.Document) error
- func (s *Session) ReloadConfig() error
- func (s *Session) RenameSymbol(doc *view.Document, viewID view.Id, name string) error
- func (s *Session) RenameSymbolPrefill(doc *view.Document, viewID view.Id) (string, error)
- func (s *Session) ResolveCompletion(_ *view.Document, _ view.Id, item *view.CompletionItem) (*view.CompletionItem, error)
- func (s *Session) ResolveDocumentLink(doc *view.Document, link view.DocumentLink) (view.DocumentLink, error)
- func (s *Session) RestartLanguageServers(doc *view.Document, names []string) ([]string, error)
- func (s *Session) SignatureHelp(doc *view.Document, viewID view.Id) (view.SignatureHelp, error)
- func (s *Session) StopLanguageServers(doc *view.Document, names []string) ([]string, error)
- func (s *Session) TriggerCompletions(doc *view.Document, viewID view.Id) (view.CompletionResult, error)
- func (s *Session) TriggerSignatureHelp(doc *view.Document, viewID view.Id) (view.SignatureHelp, error)
- func (s *Session) WillCreateFile(path string, dir bool) error
- func (s *Session) WillDeleteFile(path string, dir bool) error
- func (s *Session) WillRenameFile(rename view.FileRename, dir bool) error
- func (s *Session) WorkspaceCommands(doc *view.Document) []string
- func (s *Session) WorkspaceSymbols(doc *view.Document, query string) ([]view.Symbol, error)
- type TransportConfig
- type WorkspaceRequest
Constants ¶
const DefaultClientName = "toe"
DefaultClientName is the client identifier sent to language servers
Variables ¶
var ( ErrCommandRequired = errors.New("language server command required") ErrRequiredRoot = errors.New("required language server root not found") ErrServerNotFound = errors.New("language server not found") )
var ( ErrLanguageServerExited = errors.New("language server exited") ErrLanguageServerRequest = errors.New("language server request failed") )
var ( ErrWorkspaceEditUnsupported = errors.New("workspace edit unsupported") ErrWorkspaceEditURI = errors.New("workspace edit URI unsupported") ErrWorkspaceEditRange = errors.New("workspace edit range invalid") ErrWorkspaceEditFile = errors.New( "workspace edit file operation failed", ) )
Functions ¶
func DefaultClientCapabilities ¶
func DefaultClientCapabilities() protocol.ClientCapabilities
DefaultClientCapabilities returns the editor's LSP client capabilities
func NewInitializeParams ¶
func NewInitializeParams(cfg InitializeConfig) *protocol.InitializeParams
NewInitializeParams builds an InitializeParams message from the given config
func OffsetEncoding ¶
func OffsetEncoding( capabilities protocol.ServerCapabilities, ) protocol.PositionEncodingKind
OffsetEncoding resolves the preferred position encoding
func ResolveWorkspace ¶
func ResolveWorkspace(req WorkspaceRequest) (string, bool)
ResolveWorkspace locates the nearest workspace root for the given file path
func RootFound ¶ added in v0.1.10
RootFound reports whether any required root pattern matches a directory entry
func SupportsFeature ¶
func SupportsFeature( capabilities protocol.ServerCapabilities, feature Feature, ) bool
SupportsFeature reports whether the capability set supports the named feature
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages a connection to a single language server process
func NewClient ¶
func NewClient( ctx context.Context, rwc io.ReadWriteCloser, handler protocol.Client, ) (context.Context, *Client)
NewClient dials the server and returns a ready Client
func Start ¶
func Start(cfg *TransportConfig) (context.Context, *Client, error)
Start launches the language server process and returns a connected Client
func (*Client) Capabilities ¶
func (c *Client) Capabilities() (protocol.ServerCapabilities, bool)
Capabilities returns initialized server capabilities
func (*Client) CodeActions ¶
func (c *Client) CodeActions( ctx context.Context, doc DocumentSnapshot, r core.Range, diags []protocol.Diagnostic, ) ([]protocol.CommandOrCodeAction, bool, error)
CodeActions requests code actions and commands for a selection
func (*Client) Completion ¶
func (c *Client) Completion( ctx context.Context, doc DocumentSnapshot, pos int, compCtx protocol.CompletionContext, ) (CompletionList, bool, error)
Completion requests completion items from the server at the given position
func (*Client) DidChangeDocument ¶
func (c *Client) DidChangeDocument( ctx context.Context, doc DocumentSnapshot, change view.DocumentChange, ) (bool, error)
DidChangeDocument notifies the server that a document was edited
func (*Client) DidChangeWatchedFile ¶
DidChangeWatchedFile notifies the server that a watched file changed
func (*Client) DidChangeWatchedFiles ¶
DidChangeWatchedFiles notifies the server that watched files changed
func (*Client) DidCreateFile ¶
DidCreateFile notifies the server that a file was created
func (*Client) DidDeleteFile ¶
DidDeleteFile notifies the server that a file was deleted
func (*Client) DidRenameFile ¶
func (c *Client) DidRenameFile( ctx context.Context, rename view.FileRename, dir bool, ) (bool, error)
DidRenameFile notifies the server that a file was renamed
func (*Client) DocumentColors ¶
func (c *Client) DocumentColors( ctx context.Context, doc DocumentSnapshot, ) ([]protocol.ColorInformation, bool, error)
DocumentColors requests document-wide colors
func (*Client) DocumentDiagnostics ¶
func (c *Client) DocumentDiagnostics( ctx context.Context, doc DocumentSnapshot, previousID *string, ) (protocol.DocumentDiagnosticReport, bool, error)
DocumentDiagnostics pulls diagnostics for a document
func (*Client) DocumentHighlights ¶
func (c *Client) DocumentHighlights( ctx context.Context, doc DocumentSnapshot, pos int, ) ([]protocol.DocumentHighlight, bool, error)
DocumentHighlights requests same-document symbol highlights at pos
func (*Client) DocumentLinks ¶
func (c *Client) DocumentLinks( ctx context.Context, doc DocumentSnapshot, ) ([]protocol.DocumentLink, bool, error)
DocumentLinks requests document-wide links
func (*Client) DocumentSymbols ¶
func (c *Client) DocumentSymbols( ctx context.Context, doc DocumentSnapshot, ) (protocol.DocumentSymbolResult, bool, error)
DocumentSymbols requests the document symbol tree from the server
func (*Client) ExecuteCommand ¶
func (c *Client) ExecuteCommand( ctx context.Context, params *protocol.ExecuteCommandParams, ) error
ExecuteCommand executes a workspace command on the server
func (*Client) FormatDocument ¶
func (c *Client) FormatDocument( ctx context.Context, doc DocumentSnapshot, opts protocol.FormattingOptions, ) ([]protocol.TextEdit, bool, error)
FormatDocument requests whole-document formatting edits
func (*Client) FormatRange ¶
func (c *Client) FormatRange( ctx context.Context, doc DocumentSnapshot, r core.Range, opts protocol.FormattingOptions, ) ([]protocol.TextEdit, bool, error)
FormatRange requests range-formatting edits
func (*Client) GotoDeclaration ¶
func (c *Client) GotoDeclaration( ctx context.Context, doc DocumentSnapshot, pos int, ) ([]protocol.Location, bool, error)
GotoDeclaration requests the declaration location of the symbol at pos
func (*Client) GotoDefinition ¶
func (c *Client) GotoDefinition( ctx context.Context, doc DocumentSnapshot, pos int, ) ([]protocol.Location, bool, error)
GotoDefinition requests the definition location of the symbol at pos
func (*Client) GotoImplementation ¶
func (c *Client) GotoImplementation( ctx context.Context, doc DocumentSnapshot, pos int, ) ([]protocol.Location, bool, error)
GotoImplementation requests implementation locations for the symbol at pos
func (*Client) GotoReference ¶
func (c *Client) GotoReference( ctx context.Context, doc DocumentSnapshot, pos int, ) ([]protocol.Location, bool, error)
GotoReference requests all reference locations for the symbol at pos
func (*Client) GotoTypeDefinition ¶
func (c *Client) GotoTypeDefinition( ctx context.Context, doc DocumentSnapshot, pos int, ) ([]protocol.Location, bool, error)
GotoTypeDefinition requests the type definition location of the symbol at pos
func (*Client) Hover ¶
func (c *Client) Hover( ctx context.Context, doc DocumentSnapshot, pos int, ) (*protocol.Hover, bool, error)
Hover requests documentation for the symbol at a position
func (*Client) Initialize ¶
func (c *Client) Initialize( ctx context.Context, params *protocol.InitializeParams, ) (*protocol.InitializeResult, error)
Initialize performs the LSP initialization handshake with the server
func (*Client) InlayHints ¶
func (c *Client) InlayHints( ctx context.Context, doc DocumentSnapshot, r core.Range, ) ([]protocol.InlayHint, bool, error)
InlayHints requests inlay hints for a document range
func (*Client) OffsetEncoding ¶
func (c *Client) OffsetEncoding() protocol.PositionEncodingKind
OffsetEncoding returns the position encoding kind negotiated with the server
func (*Client) PrepareRename ¶
func (c *Client) PrepareRename( ctx context.Context, doc DocumentSnapshot, pos int, ) (protocol.PrepareRenameResult, bool, error)
PrepareRename requests the server's rename range or placeholder
func (*Client) RenameSymbol ¶
func (c *Client) RenameSymbol( ctx context.Context, doc DocumentSnapshot, pos int, name string, ) (*protocol.WorkspaceEdit, bool, error)
RenameSymbol requests a workspace edit for a new symbol name
func (*Client) ResolveDocumentLink ¶
func (c *Client) ResolveDocumentLink( ctx context.Context, link protocol.DocumentLink, ) (*protocol.DocumentLink, bool, error)
ResolveDocumentLink resolves a stored document link target when supported
func (*Client) SignatureHelp ¶
func (c *Client) SignatureHelp( ctx context.Context, doc DocumentSnapshot, pos int, shCtx protocol.SignatureHelpContext, ) (*protocol.SignatureHelp, bool, error)
SignatureHelp requests parameter hints for the call at a position
func (*Client) State ¶
func (c *Client) State() ClientState
State returns the current lifecycle state of the client
func (*Client) SupportsFeature ¶
SupportsFeature reports whether the server supports the given LSP feature
func (*Client) WillCreateFile ¶
func (c *Client) WillCreateFile( ctx context.Context, path string, dir bool, ) (*protocol.WorkspaceEdit, bool, error)
WillCreateFile asks the server for edits to make before a file is created
func (*Client) WillDeleteFile ¶
func (c *Client) WillDeleteFile( ctx context.Context, path string, dir bool, ) (*protocol.WorkspaceEdit, bool, error)
WillDeleteFile asks the server for edits to make before a file is deleted
func (*Client) WillRenameFile ¶
func (c *Client) WillRenameFile( ctx context.Context, rename view.FileRename, dir bool, ) (*protocol.WorkspaceEdit, bool, error)
WillRenameFile asks the server for edits to make before a file is renamed
func (*Client) WorkspaceSymbols ¶
func (c *Client) WorkspaceSymbols( ctx context.Context, query string, ) (protocol.WorkspaceSymbolResult, bool, error)
WorkspaceSymbols requests workspace symbols matching query from the server
type ClientState ¶
type ClientState int
ClientState is the lifecycle state of a Client
const ( ClientNew ClientState = iota ClientInitialized ClientShutdown )
ClientNew is the initial state; ClientInitialized means handshake complete; ClientShutdown means closed
type CompletionList ¶
type CompletionList struct {
Items []*view.CompletionItem
Raw []protocol.CompletionItem
Incomplete bool
}
CompletionList is a normalized completion response
type DocumentSnapshot ¶
DocumentSnapshot is the LSP-visible state of a file-backed document
func SnapshotDocument ¶
func SnapshotDocument(doc *view.Document) (DocumentSnapshot, bool)
SnapshotDocument captures the current file-backed view document state
type Feature ¶
type Feature int
Feature names an LSP capability group the editor can query before issuing requests
const ( FeatureFormat Feature = iota FeatureRangeFormat FeatureGotoDeclaration FeatureGotoDefinition FeatureGotoTypeDefinition FeatureGotoReference FeatureGotoImplementation FeatureSignatureHelp FeatureHover FeatureDocumentHighlight FeatureCompletion FeatureCodeAction FeatureDocumentLinks FeatureWorkspaceCommand FeatureDocumentSymbols FeatureWorkspaceSymbols FeatureDiagnostics FeaturePullDiagnostics FeatureRename FeatureInlayHints FeatureDocumentColors FeatureCallHierarchy )
Feature constants name the LSP capability groups the editor supports
type InitializeConfig ¶
type InitializeConfig struct {
ClientName string
ClientVersion string
WorkspaceRoot string
InitializationOptions protocol.LSPAny
}
InitializeConfig holds parameters for LSP server initialization
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps named server configurations to running client connections
func NewRegistry ¶
NewRegistry creates a Registry seeded with the given server configurations
type RegistryStartArgs ¶ added in v0.2.0
RegistryStartArgs names the server to launch and the directory to run it in
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session owns runtime language-server clients for an editor
func NewSession ¶
NewSession creates an LSP session from language configuration
func (*Session) ApplyCodeAction ¶
ApplyCodeAction applies a selected code action or command
func (*Session) ApplyCompletion ¶
func (s *Session) ApplyCompletion( doc *view.Document, viewID view.Id, item *view.CompletionItem, ) error
ApplyCompletion applies the selected completion item to the document
func (*Session) ApplyWorkspaceEdit ¶
func (s *Session) ApplyWorkspaceEdit( server string, edit protocol.WorkspaceEdit, ) error
ApplyWorkspaceEdit applies a server-provided workspace edit
func (*Session) Busy ¶
Busy reports whether any language server has an in-flight progress notification, for the status-line activity spinner
func (*Session) CodeActions ¶
CodeActions returns code actions and commands for the current selection
func (*Session) Completions ¶
Completions requests an invoked completion list at the cursor
func (*Session) DidCreateFile ¶
DidCreateFile tells every server that path was created
func (*Session) DidDeleteFile ¶
DidDeleteFile tells every server that path was deleted
func (*Session) DidRenameFile ¶
func (s *Session) DidRenameFile(rename view.FileRename, dir bool) error
DidRenameFile tells every server that a path was renamed
func (*Session) DocumentChanged ¶
func (s *Session) DocumentChanged( doc *view.Document, change view.DocumentChange, )
DocumentChanged sends didChange notifications to attached servers
func (*Session) DocumentClosed ¶
DocumentClosed sends didClose notifications and forgets the document
func (*Session) DocumentColors ¶
DocumentColors returns document-wide colors and stores them on the document
func (*Session) DocumentHighlights ¶
func (s *Session) DocumentHighlights( doc *view.Document, viewID view.Id, ) ([]view.DocumentHighlight, error)
DocumentHighlights returns same-document symbol highlights at the cursor
func (*Session) DocumentLinks ¶
DocumentLinks returns document-wide links and stores them on the document
func (*Session) DocumentOpened ¶
DocumentOpened starts matching servers and sends didOpen notifications
func (*Session) DocumentSaved ¶
DocumentSaved sends didSave notifications to attached servers
func (*Session) DocumentSymbols ¶
DocumentSymbols returns flattened symbols from all document servers
func (*Session) ExecuteWorkspaceCommand ¶
ExecuteWorkspaceCommand runs a named workspace command on the matching server
func (*Session) FormatDocument ¶
FormatDocument applies whole-document formatting from a language server
func (*Session) FormatSelection ¶
FormatSelection applies range formatting for the current primary selection
func (*Session) GotoDeclaration ¶
GotoDeclaration returns declaration locations for the symbol at the cursor
func (*Session) GotoDefinition ¶
GotoDefinition returns definition locations for the symbol at the cursor
func (*Session) GotoImplementation ¶
func (s *Session) GotoImplementation( doc *view.Document, viewID view.Id, ) ([]view.Location, error)
GotoImplementation returns implementation locations for the symbol at the cursor
func (*Session) GotoReference ¶
GotoReference returns all reference locations for the symbol at the cursor
func (*Session) GotoTypeDefinition ¶
func (s *Session) GotoTypeDefinition( doc *view.Document, viewID view.Id, ) ([]view.Location, error)
GotoTypeDefinition returns type definition locations for the symbol at the cursor
func (*Session) InlayHints ¶
InlayHints returns language-server hints and stores them for the view
func (*Session) LanguageServerNames ¶ added in v0.3.0
LanguageServerNames returns the servers configured for the document
func (*Session) PublishDiagnostics ¶
func (s *Session) PublishDiagnostics( _ context.Context, params *protocol.PublishDiagnosticsParams, ) error
PublishDiagnostics forwards server diagnostics to the editor
func (*Session) PullDiagnostics ¶
PullDiagnostics requests fresh diagnostics from document servers
func (*Session) ReloadConfig ¶
ReloadConfig reloads language-server config and restarts open documents
func (*Session) RenameSymbol ¶
RenameSymbol applies a language-server rename edit for the current symbol
func (*Session) RenameSymbolPrefill ¶
RenameSymbolPrefill returns the initial rename prompt text
func (*Session) ResolveCompletion ¶
func (s *Session) ResolveCompletion( _ *view.Document, _ view.Id, item *view.CompletionItem, ) (*view.CompletionItem, error)
ResolveCompletion fetches extra completion item details
func (*Session) ResolveDocumentLink ¶
func (s *Session) ResolveDocumentLink( doc *view.Document, link view.DocumentLink, ) (view.DocumentLink, error)
ResolveDocumentLink resolves a document link target and updates the document
func (*Session) RestartLanguageServers ¶
RestartLanguageServers stops and restarts the named servers for the document
func (*Session) SignatureHelp ¶
SignatureHelp returns the signature help at the cursor for an invoked trigger
func (*Session) StopLanguageServers ¶
StopLanguageServers shuts down the named language servers for the document
func (*Session) TriggerCompletions ¶
func (s *Session) TriggerCompletions( doc *view.Document, viewID view.Id, ) (view.CompletionResult, error)
TriggerCompletions requests character-triggered completion
func (*Session) TriggerSignatureHelp ¶
func (s *Session) TriggerSignatureHelp( doc *view.Document, viewID view.Id, ) (view.SignatureHelp, error)
TriggerSignatureHelp returns signature help triggered by the character before the cursor
func (*Session) WillCreateFile ¶
WillCreateFile applies any edits servers want made before creating path
func (*Session) WillDeleteFile ¶
WillDeleteFile applies any edits servers want made before deleting path
func (*Session) WillRenameFile ¶
func (s *Session) WillRenameFile(rename view.FileRename, dir bool) error
WillRenameFile applies any edits servers want made before renaming
func (*Session) WorkspaceCommands ¶
WorkspaceCommands returns commands advertised by attached servers
Source Files
¶
- capabilities.go
- client.go
- code-action.go
- completion-edit.go
- completion-normalize.go
- completion.go
- document-color.go
- document-highlight.go
- document-link.go
- file-operation.go
- file-watch-fs.go
- file-watch-pattern.go
- file-watch.go
- format.go
- helpers.go
- hover.go
- initialize.go
- inlay-hint.go
- navigation.go
- progress.go
- range.go
- registry.go
- rename.go
- session-candidates.go
- session-diags.go
- session-doc-state.go
- session-doc.go
- session-servers.go
- session.go
- signature.go
- symbol.go
- sync.go
- transport.go
- workspace-edit-file.go
- workspace-edit.go
- workspace-servers.go
- workspace.go