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

Method flushChanges

internal/project/session.go:1423–1440  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

1421}
1422
1423func (s *Session) flushChanges(ctx context.Context) (FileChangeSummary, map[tspath.Path]*Overlay, map[tspath.Path]*ATAStateChange, *lsutil.UserPreferences) {
1424 s.pendingFileChangesMu.Lock()
1425 defer s.pendingFileChangesMu.Unlock()
1426 s.pendingATAChangesMu.Lock()
1427 defer s.pendingATAChangesMu.Unlock()
1428 pendingATAChanges := s.pendingATAChanges
1429 s.pendingATAChanges = make(map[tspath.Path]*ATAStateChange)
1430 fileChanges, overlays := s.flushChangesLocked(ctx)
1431 s.userConfigRWMu.Lock()
1432 defer s.userConfigRWMu.Unlock()
1433 var newPrefs *lsutil.UserPreferences
1434 if s.pendingUserConfigChanges {
1435 p := s.workspaceUserPreferences
1436 newPrefs = &p
1437 }
1438 s.pendingUserConfigChanges = false
1439 return fileChanges, overlays, pendingATAChanges, newPrefs
1440}
1441
1442// flushChangesLocked should only be called with s.pendingFileChangesMu held.
1443func (s *Session) flushChangesLocked(ctx context.Context) (FileChangeSummary, map[tspath.Path]*Overlay) {

Callers 4

APIUpdateMethod · 0.95
getSnapshotMethod · 0.95

Calls 4

flushChangesLockedMethod · 0.95
makeFunction · 0.50
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected