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

Method evictChangedSourceFiles

internal/execute/watcher.go:356–368  ·  view source on GitHub ↗
(changedPaths map[string]fswatch.EventKind)

Source from the content-addressed store, hash-verified

354}
355
356func (w *Watcher) evictChangedSourceFiles(changedPaths map[string]fswatch.EventKind) {
357 caseSensitive := w.sys.FS().UseCaseSensitiveFileNames()
358 cwd := w.sys.GetCurrentDirectory()
359 for eventPath := range changedPaths {
360 p := tspath.ToPath(eventPath, cwd, caseSensitive)
361 if _, ok := w.sourceFileCache.Load(p); ok {
362 if w.wm.DebugLog != nil {
363 fmt.Fprintf(w.wm.DebugLog, "[watch] evicting cached source file: %s\n", p)
364 }
365 w.sourceFileCache.Delete(p)
366 }
367 }
368}
369
370func (w *Watcher) compileAndEmit() tsc.CompileAndEmitResult {
371 return tsc.EmitFilesAndReportErrors(tsc.EmitInput{

Callers 1

DoCycleMethod · 0.95

Calls 6

ToPathFunction · 0.92
FSMethod · 0.65
GetCurrentDirectoryMethod · 0.65
DeleteMethod · 0.65
LoadMethod · 0.45

Tested by

no test coverage detected