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

Method flushChangesLocked

internal/project/session.go:1443–1455  ·  view source on GitHub ↗

flushChangesLocked should only be called with s.pendingFileChangesMu held.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1441
1442// flushChangesLocked should only be called with s.pendingFileChangesMu held.
1443func (s *Session) flushChangesLocked(ctx context.Context) (FileChangeSummary, map[tspath.Path]*Overlay) {
1444 if len(s.pendingFileChanges) == 0 {
1445 return FileChangeSummary{}, s.fs.Overlays()
1446 }
1447
1448 start := time.Now()
1449 changes, overlays := s.fs.processChanges(s.pendingFileChanges)
1450 if s.options.LoggingEnabled {
1451 s.logger.Log(fmt.Sprintf("Processed %d file changes in %v", len(s.pendingFileChanges), time.Since(start)))
1452 }
1453 s.pendingFileChanges = nil
1454 return changes, overlays
1455}
1456
1457// logProjectChanges logs information about projects that have changed between snapshots
1458func (s *Session) logProjectChanges(oldSnapshot *Snapshot, newSnapshot *Snapshot) {

Callers 2

DidOpenFileMethod · 0.95
flushChangesMethod · 0.95

Calls 5

lenFunction · 0.85
OverlaysMethod · 0.80
processChangesMethod · 0.80
NowMethod · 0.65
LogMethod · 0.65

Tested by

no test coverage detected