| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:core'; | 7 import 'dart:core'; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 import 'dart:math' show max; | 9 import 'dart:math' show max; |
| 10 | 10 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 682 |
| 683 /** | 683 /** |
| 684 * Return an analysis driver to which the file with the given [path] is | 684 * Return an analysis driver to which the file with the given [path] is |
| 685 * added if one exists, otherwise a driver in which the file was analyzed if | 685 * added if one exists, otherwise a driver in which the file was analyzed if |
| 686 * one exists, otherwise the first driver, otherwise `null`. | 686 * one exists, otherwise the first driver, otherwise `null`. |
| 687 */ | 687 */ |
| 688 nd.AnalysisDriver getAnalysisDriver(String path) { | 688 nd.AnalysisDriver getAnalysisDriver(String path) { |
| 689 Iterable<nd.AnalysisDriver> drivers = driverMap.values; | 689 Iterable<nd.AnalysisDriver> drivers = driverMap.values; |
| 690 if (drivers.isNotEmpty) { | 690 if (drivers.isNotEmpty) { |
| 691 nd.AnalysisDriver driver = drivers.firstWhere( | 691 nd.AnalysisDriver driver = drivers.firstWhere( |
| 692 (driver) => driver.addedFiles.contains(path), | 692 (driver) => driver.contextRoot.containsFile(path), |
| 693 orElse: () => null); | 693 orElse: () => null); |
| 694 driver ??= drivers.firstWhere( | 694 driver ??= drivers.firstWhere( |
| 695 (driver) => driver.knownFiles.contains(path), | 695 (driver) => driver.knownFiles.contains(path), |
| 696 orElse: () => null); | 696 orElse: () => null); |
| 697 driver ??= drivers.first; | 697 driver ??= drivers.first; |
| 698 return driver; | 698 return driver; |
| 699 } | 699 } |
| 700 return null; | 700 return null; |
| 701 } | 701 } |
| 702 | 702 |
| (...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2364 /** | 2364 /** |
| 2365 * The [PerformanceTag] for time spent in server request handlers. | 2365 * The [PerformanceTag] for time spent in server request handlers. |
| 2366 */ | 2366 */ |
| 2367 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 2367 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
| 2368 | 2368 |
| 2369 /** | 2369 /** |
| 2370 * The [PerformanceTag] for time spent in split store microtasks. | 2370 * The [PerformanceTag] for time spent in split store microtasks. |
| 2371 */ | 2371 */ |
| 2372 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 2372 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 2373 } | 2373 } |
| OLD | NEW |