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

Side by Side Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 2658983004: Implement AnalysisDriver.getSourceKind() and use it in analyzer-cli. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/analyzer_cli/lib/src/analyzer_impl.dart ('k') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer_cli.src.driver; 5 library analyzer_cli.src.driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } else { 223 } else {
224 context.applyChanges(changeSet); 224 context.applyChanges(changeSet);
225 } 225 }
226 } 226 }
227 227
228 // Analyze the libraries. 228 // Analyze the libraries.
229 ErrorSeverity allResult = ErrorSeverity.NONE; 229 ErrorSeverity allResult = ErrorSeverity.NONE;
230 var libUris = <Uri>[]; 230 var libUris = <Uri>[];
231 var parts = <Source>[]; 231 var parts = <Source>[];
232 for (Source source in sourcesToAnalyze) { 232 for (Source source in sourcesToAnalyze) {
233 if (context.computeKindOf(source) == SourceKind.PART) { 233 SourceKind sourceKind = analysisDriver != null
234 ? await analysisDriver.getSourceKind(source.fullName)
235 : context.computeKindOf(source);
236 if (sourceKind == SourceKind.PART) {
234 parts.add(source); 237 parts.add(source);
235 continue; 238 continue;
236 } 239 }
237 ErrorSeverity status = await _runAnalyzer(source, options); 240 ErrorSeverity status = await _runAnalyzer(source, options);
238 allResult = allResult.max(status); 241 allResult = allResult.max(status);
239 libUris.add(source.uri); 242 libUris.add(source.uri);
240 } 243 }
241 244
242 // Check that each part has a corresponding source in the input list. 245 // Check that each part has a corresponding source in the input list.
243 for (Source part in parts) { 246 for (Source part in parts) {
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 for (var package in packages) { 916 for (var package in packages) {
914 var packageName = path.basename(package.path); 917 var packageName = path.basename(package.path);
915 var realPath = package.resolveSymbolicLinksSync(); 918 var realPath = package.resolveSymbolicLinksSync();
916 result[packageName] = [ 919 result[packageName] = [
917 PhysicalResourceProvider.INSTANCE.getFolder(realPath) 920 PhysicalResourceProvider.INSTANCE.getFolder(realPath)
918 ]; 921 ];
919 } 922 }
920 return result; 923 return result;
921 } 924 }
922 } 925 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/lib/src/analyzer_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698