Documentation ¶
Index ¶
- type CLILangServer
- type CapabilitiesHook
- type CommandConn
- type ConnStore
- type EditApplier
- type FileBinder
- type FileContainer
- type FileManager
- type FileOpener
- type FileSaver
- type Format
- type FormatOnSave
- type GotoDefinition
- func (w *GotoDefinition) DefaultEvent() string
- func (w *GotoDefinition) Menu(context.Context) string
- func (w *GotoDefinition) Name(context.Context) string
- func (w *GotoDefinition) Op(ctx context.Context, b input.Binder) (input.Operation, error)
- func (w *GotoDefinition) Type(input.Command)
- func (w *GotoDefinition) Valid(ctx context.Context, b input.Binder) error
- type Informer
- type LSPSync
- func (s *LSPSync) FileClosed(ctx context.Context, b input.Binder)
- func (s *LSPSync) FileOpened(ctx context.Context, b input.Binder)
- func (s *LSPSync) Name(context.Context) string
- func (s *LSPSync) OpNames(context.Context) []string
- func (s *LSPSync) TextChanged(ctx context.Context, b input.Binder, hist ...)
- func (s *LSPSync) TextChangedOp(ctx context.Context, b input.Binder) input.Operation
- func (s *LSPSync) Type(input.Hook)
- func (s *LSPSync) Valid(ctx context.Context, b input.Binder) (retErr error)
- type Pather
- type Prompt
- type Rename
- func (w *Rename) DefaultEvent() string
- func (r *Rename) Menu(context.Context) string
- func (r *Rename) Name(context.Context) string
- func (r *Rename) Op(ctx context.Context, b input.Binder) (input.Operation, error)
- func (r *Rename) Type(input.Command)
- func (r *Rename) Valid(ctx context.Context, b input.Binder) (err error)
- type RenameCapabilities
- type SelectionSetter
- type SelectionStorer
- type ServerHook
- type ServerOp
- func (s *ServerOp) Conn(ctx context.Context, b input.Binder) (lsp.Conn, protocol.ServerCapabilities, error)
- func (s *ServerOp) Empty(context.Context) input.HookedOperation
- func (s *ServerOp) Name(context.Context) string
- func (s *ServerOp) Run(ctx context.Context, b input.Binder) error
- func (s *ServerOp) SetHook(ctx context.Context, h input.Hook) error
- func (s *ServerOp) Setup(ctx context.Context, b input.Binder) error
- func (s *ServerOp) Type(input.Operation)
- func (s *ServerOp) Valid(ctx context.Context, b input.Binder) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLILangServer ¶
type CLILangServer struct {
// contains filtered or unexported fields
}
CLILangServer is an operation for constructing a language server from a command and connecting to its stdout and stdin. It is provided as sugar for plugins to more easily create language servers.
We provide this as an Action rather than a part of pkg/lsp to decouple the CLI language server logic from plugins.
func NewCLILangServer ¶
func NewCLILangServer() *CLILangServer
func (*CLILangServer) FromCommand ¶
func (*CLILangServer) Type ¶
func (c *CLILangServer) Type(input.Operation)
type CapabilitiesHook ¶
type CapabilitiesHook interface { input.Hook // Capabilities returns the capabilities that are added to vidar. Capabilities(context.Context) protocol.ClientCapabilities }
CapabilitiesHook is an input.Hook that tells the LanguageServer plugin about language server capabilities the plugin that it is a part of adds to vidar.
type CommandConn ¶
type CommandConn struct {
// contains filtered or unexported fields
}
CommandConn implements a connection over STDIN/STDOUT on a command.
type ConnStore ¶
type ConnStore interface { input.Action Conn(context.Context, input.Binder) (lsp.Conn, protocol.ServerCapabilities, error) }
ConnStore is the action that needs to be bound to give us access to the connected language server.
type EditApplier ¶
type EditApplier interface { input.Operation ApplyEdit(...input.Edit) input.Operation ApplyLineEdit(...input.LineEdit) input.Operation }
EditApplier is the action that we use to apply changes to a document.
type FileBinder ¶
type FileContainer ¶
type FileManager ¶
type FileManager interface { input.Action OpenFile(name, path string) input.Operation After(func(context.Context, input.Binder) error) input.Operation }
FileManager is the action type that manages files.
type FileOpener ¶
type FileSaver ¶
FileSaver is the action that we use to save the file (again) after applying formatting.
type FormatOnSave ¶
type FormatOnSave struct {
// contains filtered or unexported fields
}
func NewFormatOnSave ¶
func NewFormatOnSave() *FormatOnSave
func (*FormatOnSave) FileSaving ¶
func (*FormatOnSave) Type ¶
func (f *FormatOnSave) Type(input.Hook)
type GotoDefinition ¶
type GotoDefinition struct {
// contains filtered or unexported fields
}
func NewGotoDefinition ¶
func NewGotoDefinition(ctx context.Context) *GotoDefinition
func (*GotoDefinition) DefaultEvent ¶
func (w *GotoDefinition) DefaultEvent() string
func (*GotoDefinition) Type ¶
func (w *GotoDefinition) Type(input.Command)
type Informer ¶
type Informer interface { Box() input.Binder Info(string) input.Operation Warn(string) input.Operation Error(string) input.Operation }
Informer represents an informational action. It is required to allow the language server to send requests to vidar.
type LSPSync ¶
type LSPSync struct {
// contains filtered or unexported fields
}
LSPSync implements the document synchronization required by the language server protocol. It hooks into core operations to keep documents in sync with the language server, if any.
func NewLSPSync ¶
func (*LSPSync) TextChanged ¶
func (*LSPSync) TextChangedOp ¶
type RenameCapabilities ¶
type RenameCapabilities struct{}
func NewRenameCaps ¶
func NewRenameCaps() *RenameCapabilities
func (*RenameCapabilities) Capabilities ¶
func (r *RenameCapabilities) Capabilities(context.Context) protocol.ClientCapabilities
func (*RenameCapabilities) Type ¶
func (r *RenameCapabilities) Type(input.Hook)
type SelectionSetter ¶
type SelectionSetter interface { input.Action Select(caret.Selection, ...caret.Selection) input.Operation }
SelectionSetter represents an operation that can move selections.
type SelectionStorer ¶
type SelectionStorer interface { input.Binder Path(context.Context) (string, bool) Selections(context.Context) (caret.Selection, []caret.Selection) State(context.Context) text.State }
SelectionStorer represents a type that tracks selections and understands positions within a file.
type ServerHook ¶
type ServerHook interface { input.Hook // Initialize is called by the LanguageServer plugin when a new file is // opened. It is up to the individual language server Action to choose // whether to return an existing language server connection or create a new // one. Most of the time, at most one language server should be open per // workspace. // // A ServerHook should implement PickyAction and only bind if the // input.Binder is editing a file that the language server understands. // // If more than one ServerHook is bound to a given input.Binder, the first // one to Initialize without error will be used. Initialize( _ context.Context, b input.Binder, filePath string, caps protocol.ClientCapabilities, ) (lsp.Conn, protocol.ServerCapabilities, error) }
ServerHook is an input.Hook that can create connections to a language server.
type ServerOp ¶
type ServerOp struct {
// contains filtered or unexported fields
}
ServerOp is an op which records any open language server connection(s) for the current input.Binder for use by other input.Action types. The main reason to
func NewLSP ¶
func NewLSP() *ServerOp
NewLSP returns a LanguageServer operation for registering langauge server connections for an open input.Binder.