Something went wrong. Try again.
clone
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536package handler
import ( "context"
protocol "github.com/tliron/glsp/protocol_3_16" "github.com/tliron/glsp/server")
type Handler struct { server *server.Server handler *protocol.Handler lsName string version string}
func New(lsName, version string) *Handler { h := new(Handler) h.lsName = lsName h.version = version
h.handler = &protocol.Handler{ Initialize: h.Initialize, Initialized: h.Initialized, Shutdown: h.Shutdown,
TextDocumentCompletion: h.TextDocument_Completion, }
h.server = server.NewServer(h.handler, lsName, true)
return h}
func (r *Handler) Do(ctx context.Context) error { return r.server.RunStdio() }