Documentation ¶
Overview ¶
Package lsp provides a pluggable language server protocol implementation, as well as utilities to make building language servers easier.
Index ¶
- func UTF16Len(s []byte) int
- type File
- type Handler
- type NopHandler
- func (NopHandler) Capabilities() types.ServerCapabilities
- func (NopHandler) HandleChange(types.DidChangeTextDocumentParams) error
- func (NopHandler) HandleClose(types.DidCloseTextDocumentParams) error
- func (NopHandler) HandleDefinition(types.DefinitionParams) ([]types.Location, error)
- func (NopHandler) HandleOpen(types.DidOpenTextDocumentParams) error
- func (NopHandler) HandleReferences(types.ReferenceParams) ([]types.Location, error)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a representation of a text file that can be modified by LSP text document change events. It keeps track of line breaks to allow for efficient conversion between byte offsets and LSP positions.
func (*File) ApplyChange ¶
func (f *File) ApplyChange(change types.TextDocumentContentChangeEvent) error
ApplyChange applies the given change to the file content.
func (*File) GetPosition ¶
GetPosition returns the LSP protocol position for the given byte offset.
type Handler ¶
type Handler interface { Capabilities() types.ServerCapabilities HandleOpen(params types.DidOpenTextDocumentParams) error HandleClose(params types.DidCloseTextDocumentParams) error HandleChange(params types.DidChangeTextDocumentParams) error HandleDefinition(params types.DefinitionParams) ([]types.Location, error) HandleReferences(params types.ReferenceParams) ([]types.Location, error) }
Handler is an interface for handling LSP requests.
type NopHandler ¶
type NopHandler struct{}
NopHandler can be embedded in a struct to provide no-op implementations of ununsed Handler methods.
func (NopHandler) Capabilities ¶
func (NopHandler) Capabilities() types.ServerCapabilities
Capabilities implements Handler.
func (NopHandler) HandleChange ¶
func (NopHandler) HandleChange(types.DidChangeTextDocumentParams) error
HandleChange implements Handler.
func (NopHandler) HandleClose ¶
func (NopHandler) HandleClose(types.DidCloseTextDocumentParams) error
HandleClose implements Handler.
func (NopHandler) HandleDefinition ¶
func (NopHandler) HandleDefinition(types.DefinitionParams) ([]types.Location, error)
HandleDefinition implements Handler.
func (NopHandler) HandleOpen ¶
func (NopHandler) HandleOpen(types.DidOpenTextDocumentParams) error
HandleOpen implements Handler.
func (NopHandler) HandleReferences ¶
func (NopHandler) HandleReferences(types.ReferenceParams) ([]types.Location, error)
HandleReferences implements Handler.
Directories ¶
Path | Synopsis |
---|---|
Package jsonrpc provides utilities for working with the JSON-RPC protocol.
|
Package jsonrpc provides utilities for working with the JSON-RPC protocol. |
Package testutil provides common utilities for testing the LSP server.
|
Package testutil provides common utilities for testing the LSP server. |
Package types contains the Language Server Protocol specification types.
|
Package types contains the Language Server Protocol specification types. |