From 8fa31daeba7a6617f08027a5f9f68bb612587772 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 2 Mar 2026 14:05:16 +0200 Subject: lsp: cancel handler contexts on shutdown via server context (task 423) --- internal/lsp/handlers_document.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'internal/lsp/handlers_document.go') diff --git a/internal/lsp/handlers_document.go b/internal/lsp/handlers_document.go index b907014..e39022e 100644 --- a/internal/lsp/handlers_document.go +++ b/internal/lsp/handlers_document.go @@ -2,7 +2,6 @@ package lsp import ( - "context" "encoding/json" "strings" "time" @@ -166,7 +165,7 @@ func (s *Server) detectAndHandleChat(uri string) { return } go func(prompt string, remove int) { - ctx, cancel := context.WithTimeout(context.Background(), 25*time.Second) + ctx, cancel := s.requestTimeoutContext(25 * time.Second) defer cancel() // Build messages with history and context_mode aware extras. pos := Position{Line: lineIdx, Character: lastIdx + 1} -- cgit v1.2.3