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

Unified Diff: pkg/analyzer/lib/src/analyzer_impl.dart

Issue 973683004: Fully parse SDK files when analyzing in batch mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/bin/analyzer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index be28a684f9f26588ced93eb4c7313ac1cadbd2e4..222aad7f1a1378830e54f1b91ee62255a1a1f437 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -40,6 +40,12 @@ class AnalyzerImpl {
final CommandLineOptions options;
final int startTime;
+
+ /**
+ * True if the analyzer is running in batch mode.
+ */
+ final bool isBatch;
+
ContentCache contentCache = new ContentCache();
SourceFactory sourceFactory;
@@ -55,7 +61,7 @@ class AnalyzerImpl {
final HashMap<Source, AnalysisErrorInfo> sourceErrorsMap =
new HashMap<Source, AnalysisErrorInfo>();
- AnalyzerImpl(String sourcePath, this.options, this.startTime)
+ AnalyzerImpl(String sourcePath, this.options, this.startTime, this.isBatch)
: sourcePath = _normalizeSourcePath(sourcePath) {
if (sdk == null) {
sdk = new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath));
@@ -263,6 +269,13 @@ class AnalyzerImpl {
// ability to suppress errors, warnings, and hints for files reached via
// custom URI's using the "--url-mapping" flag.
if (source.uri.scheme == 'dart') {
+ if (isBatch) {
+ // When running in batch mode, the SDK files are cached from one
+ // analysis run to the next. So we need to parse function bodies even
+ // if the user hasn't asked for errors/warnings from the SDK, since
+ // they might ask for errors/warnings from the SDK in the future.
+ return true;
+ }
return options.showSdkWarnings;
}
if (source.uri.scheme == 'package') {
« no previous file with comments | « pkg/analyzer/bin/analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698