MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getFile

Method getFile

internal/project/overlayfs.go:194–209  ·  view source on GitHub ↗
(fileName string)

Source from the content-addressed store, hash-verified

192}
193
194func (fs *overlayFS) getFile(fileName string) FileHandle {
195 fs.mu.RLock()
196 overlays := fs.overlays
197 fs.mu.RUnlock()
198
199 path := fs.toPath(fileName)
200 if overlay, ok := overlays[path]; ok {
201 return overlay
202 }
203
204 content, ok := fs.fs.ReadFile(fileName)
205 if !ok {
206 return nil
207 }
208 return newDiskFile(fileName, content)
209}
210
211func (fs *overlayFS) processChanges(changes []FileChange) (FileChangeSummary, map[tspath.Path]*Overlay) {
212 fs.mu.Lock()

Callers

nothing calls this directly

Calls 3

newDiskFileFunction · 0.85
ReadFileMethod · 0.65
toPathMethod · 0.45

Tested by

no test coverage detected