(ctx context.Context)
| 1421 | } |
| 1422 | |
| 1423 | func (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. |
| 1443 | func (s *Session) flushChangesLocked(ctx context.Context) (FileChangeSummary, map[tspath.Path]*Overlay) { |
no test coverage detected