Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2898213004: Find drivers even when the file is not a dart file (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698