{"record":{"id":"9cb3e4adafe47b98","repo":"microsoft/typescript-go","slug":"failed-to-refresh-inlay-hints-w","errorCode":null,"errorMessage":"failed to refresh inlay hints: %w","messagePattern":"failed to refresh inlay hints: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"internal/lsp/server.go","lineNumber":352,"sourceCode":"\tif !s.telemetryEnabled {\n\t\tpanic(\"SendTelemetry called with telemetry disabled\")\n\t}\n\treturn sendNotification(s, lsproto.TelemetryEventInfo, telemetry)\n}\n\n// IsActive implements project.Client.\nfunc (s *Server) IsActive() bool {\n\tlast := s.lastRequestTimeMs.Load()\n\treturn last == 0 || time.Since(time.UnixMilli(last)) <= time.Minute\n}\n\nfunc (s *Server) RefreshInlayHints(ctx context.Context) error {\n\tif !s.clientCapabilities.Workspace.InlayHint.RefreshSupport {\n\t\treturn nil\n\t}\n\n\tif err := sendClientRequestFireAndForget(s, lsproto.WorkspaceInlayHintRefreshInfo, lsproto.NoParams{}); err != nil {\n\t\treturn fmt.Errorf(\"failed to refresh inlay hints: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (s *Server) RefreshCodeLens(ctx context.Context) error {\n\tif !s.clientCapabilities.Workspace.CodeLens.RefreshSupport {\n\t\treturn nil\n\t}\n\n\tif err := sendClientRequestFireAndForget(s, lsproto.WorkspaceCodeLensRefreshInfo, lsproto.NoParams{}); err != nil {\n\t\treturn fmt.Errorf(\"failed to refresh code lens: %w\", err)\n\t}\n\treturn nil\n}\n\n// ProgressStart implements project.Client.\nfunc (s *Server) ProgressStart(message *diagnostics.Message, args ...any) {\n\tif s.projectProgress != nil {","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/lsp/server.go#L334-L370","documentation":"RefreshInlayHints (server.go:346-355): the client advertised workspace.inlayHint.refreshSupport, but queueing the fire-and-forget workspace/inlayHint/refresh request failed locally (sendClientRequestFireAndForget -> s.send -> outgoingQueue.Put). As with diagnostics refresh, client responses are ignored; this error means the outgoing channel/writer rejected the message.","triggerScenarios":"Outgoing queue closed during server teardown, writer already failed, or background context canceled — typically when a configuration change triggers an inlay-hint refresh concurrently with shutdown or a crashed writer.","commonSituations":"Editor closing during a config-change-triggered refresh; test harnesses ending sessions before queued refreshes flush; a prior write error having poisoned the writer.","solutions":["Ignore during shutdown: if the background context is canceled, drop the refresh silently.","Verify the writer/stream is healthy if this occurs mid-session; a broken outgoing queue usually surfaces elsewhere too.","Call RefreshInlayHints only when capabilities advertise refreshSupport (the method already checks, but your layer should too) and treat its error as advisory."],"exampleFix":"// before\nif err := client.RefreshInlayHints(ctx); err != nil { return err }\n// after\n_ = client.RefreshInlayHints(ctx) // advisory; failure is non-fatal","handlingStrategy":"try-catch","validationCode":"if clientCaps.Workspace.InlayHint.RefreshSupport && ctx.Err() == nil {\n    if err := client.RefreshInlayHints(ctx); err != nil {\n        log.Printf(\"inlay hint refresh skipped: %v\", err)\n    }\n}","typeGuard":"func inlayRefreshSafe(caps lsproto.ResolvedClientCapabilities, ctx context.Context) bool {\n    return caps.Workspace.InlayHint.RefreshSupport && ctx.Err() == nil\n}","tryCatchPattern":"if err := client.RefreshInlayHints(ctx); err != nil {\n    if ctx.Err() != nil {\n        return nil // shutting down; outgoing queue closed\n    }\n    log.Printf(\"inlay refresh skipped: %v\", err)\n}","preventionTips":["Gate refreshes on both capability and a live context.","Keep refresh errors non-fatal (log-only) in project reload paths.","During tests, drain the outgoing queue before closing pipes so queued refreshes flush."],"tags":["lsp","inlay-hints","shutdown","fire-and-forget"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}