diff --git a/internal/langserver/handlers/initialize.go b/internal/langserver/handlers/initialize.go index 06e8829ff..b836675ee 100644 --- a/internal/langserver/handlers/initialize.go +++ b/internal/langserver/handlers/initialize.go @@ -157,8 +157,6 @@ func (svc *service) Initialize(ctx context.Context, params lsp.InitializeParams) serverCaps.Capabilities.SemanticTokensProvider = semanticTokensOpts - svc.jrpcSvr = jrpc2.ServerFromContext(ctx) - // set commandPrefix for session lsctx.SetCommandPrefix(ctx, out.Options.CommandPrefix) // apply prefix to executeCommand handler names diff --git a/internal/langserver/handlers/service.go b/internal/langserver/handlers/service.go index c284974f0..28b941d45 100644 --- a/internal/langserver/handlers/service.go +++ b/internal/langserver/handlers/service.go @@ -55,8 +55,6 @@ type service struct { server session.Server diagsNotifier *diagnostics.Notifier - jrpcSvr *jrpc2.Server - additionalHandlers map[string]rpch.Func } @@ -450,10 +448,11 @@ func (svc *service) configureSessionDependencies(ctx context.Context, cfgOpts *s sendModuleTelemetry(svc.sessCtx, svc.stateStore, svc.telemetry), func(_, newMod *state.Module) { svc.logger.Printf("Sending refresh notification for %s", newMod.Path) - _, err := svc.jrpcSvr.Callback(svc.srvCtx, "workspace/semanticTokens/refresh", nil) + _, err := jrpc2.ServerFromContext(ctx).Callback(svc.srvCtx, "workspace/semanticTokens/refresh", nil) if err != nil { svc.logger.Printf("Error refreshing %s: %s", newMod.Path, err) } + svc.logger.Printf("Sending refresh notification for %s", newMod.Path) }, }