Documentation
¶
Index ¶
- func CancelRequest(ctx context.Context, req *jrpc2.Request) error
- func Initialized(_ context.Context, _ *jrpc2.Request) error
- func NewSession(ctx context.Context) session.ServiceSession
- func TextDocumentCompletion(ctx context.Context, _ *jrpc2.Request) ([]lsp.CompletionItem, error)
- type MethodHandler
- func (mh *MethodHandler) Initialize(ctx context.Context, _ *jrpc2.Request) (lsp.InitializeResult, error)
- func (mh *MethodHandler) TSCResetConfig(ctx context.Context, _ *jrpc2.Request) error
- func (mh *MethodHandler) TSCSetConfig(ctx context.Context, req *jrpc2.Request) error
- func (mh *MethodHandler) TextDocumentDidChange(ctx context.Context, req *jrpc2.Request) error
- func (mh *MethodHandler) TextDocumentDidClose(ctx context.Context, req *jrpc2.Request) error
- func (mh *MethodHandler) TextDocumentDidOpen(ctx context.Context, req *jrpc2.Request) error
- func (mh *MethodHandler) TextDocumentFoldingRange(ctx context.Context, req *jrpc2.Request) ([]lsp.FoldingRange, error)
- func (mh *MethodHandler) TextDocumentHover(ctx context.Context, params lsp.TextDocumentPositionParams) (lsp.Hover, error)
- func (mh *MethodHandler) TextDocumentSymbol(ctx context.Context, req *jrpc2.Request) ([]lsp.DocumentSymbol, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelRequest ¶
CancelRequest will be called on "$/cancelRequest"
func Initialized ¶
Initialized is the callback that runs on the "initialized" method
func NewSession ¶
func NewSession(ctx context.Context) session.ServiceSession
NewSession instantiates a new session
Types ¶
type MethodHandler ¶
type MethodHandler struct {
// contains filtered or unexported fields
}
MethodHandler is a struct that contains a logger, as well as methods to individual method handlers
func NewMethodHandler ¶
func NewMethodHandler(logger *log.Logger) *MethodHandler
NewMethodHandler will instantiate a handler that contains callbacks to the server's methods
func (*MethodHandler) Initialize ¶
func (mh *MethodHandler) Initialize(ctx context.Context, _ *jrpc2.Request) (lsp.InitializeResult, error)
Initialize is the callback that runs on the "initialize" method
func (*MethodHandler) TSCResetConfig ¶
TSCResetConfig is the callback that runs on the "tsc/setConfig" method.
func (*MethodHandler) TSCSetConfig ¶
TSCSetConfig is the callback that runs on the "tsc/setConfig" method.
func (*MethodHandler) TextDocumentDidChange ¶
TextDocumentDidChange is the callback that runs on the "textDocument/didChange" method
func (*MethodHandler) TextDocumentDidClose ¶
TextDocumentDidClose is the callback that runs on the "textDocument/didClose" method
func (*MethodHandler) TextDocumentDidOpen ¶
TextDocumentDidOpen is the callback that runs on the "textDocument/didOpen" method
func (*MethodHandler) TextDocumentFoldingRange ¶ added in v0.1.3
func (mh *MethodHandler) TextDocumentFoldingRange(ctx context.Context, req *jrpc2.Request) ([]lsp.FoldingRange, error)
TextDocumentFoldingRange is the callback that runs on the "textDocument/foldingRange" method.
func (*MethodHandler) TextDocumentHover ¶
func (mh *MethodHandler) TextDocumentHover(ctx context.Context, params lsp.TextDocumentPositionParams) (lsp.Hover, error)
TextDocumentHover is the callback that runs on the "textDocument/hover" method.
func (*MethodHandler) TextDocumentSymbol ¶ added in v0.1.4
func (mh *MethodHandler) TextDocumentSymbol(ctx context.Context, req *jrpc2.Request) ([]lsp.DocumentSymbol, error)
TextDocumentSymbol is the callback that runs on the "textDocument/documentSymbol" method.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a handler service for sessions
func (*Service) Assigner ¶
Assigner will create the session and set up the service method/handler map
func (*Service) Finish ¶
func (service *Service) Finish(status jrpc2.ServerStatus)
Finish will terminate the service