package 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() }