MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / handleDidClose

Method handleDidClose

pkg/lsp/handler.go:346–371  ·  view source on GitHub ↗

handleDidClose handles document close notifications

(params json.RawMessage)

Source from the content-addressed store, hash-verified

344
345// handleDidClose handles document close notifications
346func (h *Handler) handleDidClose(params json.RawMessage) {
347 var p DidCloseTextDocumentParams
348 if err := json.Unmarshal(params, &p); err != nil {
349 h.server.Logger().Printf("textDocument/didClose: failed to parse params: %v (raw: %s)", err, truncateForLog(params))
350 h.sendParseError("didClose", err)
351 return
352 }
353
354 h.server.Logger().Printf("Document closed: %s", p.TextDocument.URI)
355
356 // Cancel any pending debounce timer for this document
357 h.debounceMu.Lock()
358 if t, ok := h.debounceTimers[p.TextDocument.URI]; ok {
359 t.Stop()
360 delete(h.debounceTimers, p.TextDocument.URI)
361 }
362 h.debounceMu.Unlock()
363
364 h.server.Documents().Close(p.TextDocument.URI)
365
366 // Clear diagnostics for closed document
367 h.server.SendNotification("textDocument/publishDiagnostics", PublishDiagnosticsParams{
368 URI: p.TextDocument.URI,
369 Diagnostics: []Diagnostic{},
370 })
371}
372
373// handleDidSave handles document save notifications
374func (h *Handler) handleDidSave(params json.RawMessage) {

Callers 1

HandleNotificationMethod · 0.95

Calls 6

sendParseErrorMethod · 0.95
truncateForLogFunction · 0.85
LoggerMethod · 0.80
DocumentsMethod · 0.80
SendNotificationMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected