MCPcopy Index your code
hub / github.com/MadAppGang/dingo / Invalidate

Method Invalidate

pkg/lsp/sourcemap_cache.go:121–134  ·  view source on GitHub ↗

Invalidate removes a source map from cache (called after file changes)

(goFilePath string)

Source from the content-addressed store, hash-verified

119
120// Invalidate removes a source map from cache (called after file changes)
121func (c *SourceMapCache) Invalidate(goFilePath string) {
122 dingoPath := strings.TrimSuffix(goFilePath, ".go") + ".dingo"
123 dmapPath := strings.TrimSuffix(dingoPath, ".dingo") + ".dmap"
124
125 c.mu.Lock()
126 defer c.mu.Unlock()
127
128 // CRITICAL FIX C3: Use dingoPath as key (consistent with Get())
129 if reader, ok := c.maps[dingoPath]; ok {
130 reader.Close() // Release resources (currently no-op, but future-proofs for mmap)
131 delete(c.maps, dingoPath)
132 c.logger.Debugf("Source map invalidated: %s", dmapPath)
133 }
134}
135
136// InvalidateAll clears the entire cache
137func (c *SourceMapCache) InvalidateAll() {

Callers 1

Calls 2

DebugfMethod · 0.65
CloseMethod · 0.45

Tested by 1