handlers

package
v0.0.0-...-9ded4d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelRequest

func CancelRequest(ctx context.Context, req *jrpc2.Request) error

CancelRequest will be called on "$/cancelRequest"

func Initialized

func Initialized(_ context.Context, _ *jrpc2.Request) error

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

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a handler service for sessions

func (*Service) Assigner

func (service *Service) Assigner() (jrpc2.Assigner, error)

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

func (*Service) SetLogger

func (service *Service) SetLogger(logger *log.Logger)

SetLogger overwrites the current logger of the service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL