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

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

Issue 2695863003: Fix for reporting not analyzed parts with the new analysis driver. (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 | « 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) 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 continue; 237 continue;
238 } 238 }
239 ErrorSeverity status = await _runAnalyzer(source, options); 239 ErrorSeverity status = await _runAnalyzer(source, options);
240 allResult = allResult.max(status); 240 allResult = allResult.max(status);
241 libUris.add(source.uri); 241 libUris.add(source.uri);
242 } 242 }
243 243
244 // Check that each part has a corresponding source in the input list. 244 // Check that each part has a corresponding source in the input list.
245 for (Source part in parts) { 245 for (Source part in parts) {
246 bool found = false; 246 bool found = false;
247 for (var lib in context.getLibrariesContaining(part)) { 247 if (analysisDriver != null) {
248 if (libUris.contains(lib.uri)) { 248 var partFile = analysisDriver.fsState.getFileForPath(part.fullName);
249 if (libUris.contains(partFile.library?.uri)) {
249 found = true; 250 found = true;
250 } 251 }
252 } else {
253 for (var lib in context.getLibrariesContaining(part)) {
254 if (libUris.contains(lib.uri)) {
255 found = true;
256 }
257 }
251 } 258 }
252 if (!found) { 259 if (!found) {
253 errorSink.writeln("${part.fullName} is a part and cannot be analyzed."); 260 errorSink.writeln("${part.fullName} is a part and cannot be analyzed.");
254 errorSink.writeln("Please pass in a library that contains this part."); 261 errorSink.writeln("Please pass in a library that contains this part.");
255 io.exitCode = ErrorSeverity.ERROR.ordinal; 262 io.exitCode = ErrorSeverity.ERROR.ordinal;
256 allResult = allResult.max(ErrorSeverity.ERROR); 263 allResult = allResult.max(ErrorSeverity.ERROR);
257 } 264 }
258 } 265 }
259 266
260 if (!options.machineFormat) { 267 if (!options.machineFormat) {
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 for (var package in packages) { 945 for (var package in packages) {
939 var packageName = path.basename(package.path); 946 var packageName = path.basename(package.path);
940 var realPath = package.resolveSymbolicLinksSync(); 947 var realPath = package.resolveSymbolicLinksSync();
941 result[packageName] = [ 948 result[packageName] = [
942 PhysicalResourceProvider.INSTANCE.getFolder(realPath) 949 PhysicalResourceProvider.INSTANCE.getFolder(realPath)
943 ]; 950 ];
944 } 951 }
945 return result; 952 return result;
946 } 953 }
947 } 954 }
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