MCPcopy Create free account
hub / github.com/docker/docker-language-server / removeAndCleanup

Method removeAndCleanup

internal/pkg/document/manager.go:272–286  ·  view source on GitHub ↗

removeAndCleanup removes a Document and frees associated resources.

(uri uri.URI)

Source from the content-addressed store, hash-verified

270
271// removeAndCleanup removes a Document and frees associated resources.
272func (m *Manager) removeAndCleanup(uri uri.URI) {
273 if existing, ok := m.docs[uri]; ok {
274 existing.Close()
275 delete(m.docs, uri)
276 }
277
278 if lock, ok := m.diagnosticsProcessing[uri]; ok {
279 lock.mu.Lock()
280 defer lock.mu.Unlock()
281 // resets the debounced function to avoid parsing a document
282 // that has already been closed
283 lock.queue(func() {})
284 delete(m.diagnosticsProcessing, uri)
285 }
286}

Callers 1

RemoveMethod · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected