| 1407 | } |
| 1408 | |
| 1409 | func (s *Session) Close() { |
| 1410 | // Cancel any pending scheduled snapshot update |
| 1411 | s.cancelScheduledSnapshotUpdate() |
| 1412 | // Cancel any pending diagnostics refresh |
| 1413 | s.cancelDiagnosticsRefresh() |
| 1414 | // Cancel any pending auto-import cache warming |
| 1415 | s.cancelWarmAutoImportCache() |
| 1416 | // Cancel any pending idle cache clean |
| 1417 | s.cancelIdleCacheClean() |
| 1418 | // Cancel periodic performance telemetry |
| 1419 | s.stopPerformanceTelemetry() |
| 1420 | s.backgroundQueue.Close() |
| 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() |