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

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

Issue 2755023002: Guard analysis server's getAnalysisResult, must be dart (Closed)
Patch Set: Guard analysis server's getAnalysisResult, must be dart Created 3 years, 9 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 library analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core'; 9 import 'dart:core';
10 import 'dart:io' as io; 10 import 'dart:io' as io;
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 655 }
656 return null; 656 return null;
657 } 657 }
658 658
659 /** 659 /**
660 * Return the analysis result for the file with the given [path]. The file is 660 * Return the analysis result for the file with the given [path]. The file is
661 * analyzed in one of the analysis drivers to which the file was added, 661 * analyzed in one of the analysis drivers to which the file was added,
662 * otherwise in the first driver, otherwise `null` is returned. 662 * otherwise in the first driver, otherwise `null` is returned.
663 */ 663 */
664 Future<nd.AnalysisResult> getAnalysisResult(String path) async { 664 Future<nd.AnalysisResult> getAnalysisResult(String path) async {
665 if (!AnalysisEngine.isDartFileName(path)) {
666 return null;
667 }
668
665 try { 669 try {
666 nd.AnalysisDriver driver = getAnalysisDriver(path); 670 nd.AnalysisDriver driver = getAnalysisDriver(path);
667 return await driver?.getResult(path); 671 return await driver?.getResult(path);
668 } catch (e) { 672 } catch (e) {
669 // Ignore the exception. 673 // Ignore the exception.
670 // We don't want to log the same exception again and again. 674 // We don't want to log the same exception again and again.
671 return null; 675 return null;
672 } 676 }
673 } 677 }
674 678
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 /** 2299 /**
2296 * The [PerformanceTag] for time spent in server request handlers. 2300 * The [PerformanceTag] for time spent in server request handlers.
2297 */ 2301 */
2298 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 2302 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
2299 2303
2300 /** 2304 /**
2301 * The [PerformanceTag] for time spent in split store microtasks. 2305 * The [PerformanceTag] for time spent in split store microtasks.
2302 */ 2306 */
2303 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 2307 static PerformanceTag splitStore = new PerformanceTag('splitStore');
2304 } 2308 }
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