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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2579223003: Do nothing if the changed file is not known to the driver. (Closed)
Patch Set: Rollback file_state changes. Created 4 years 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 | « no previous file | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index a6bb7faa147c8accb219d82ed66951f71b165f23..213fd0a6e59c5ce1c3717afd7e8445f735b78821 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -30,6 +30,7 @@ import 'package:analyzer/src/summary/link.dart';
import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:analyzer/src/task/dart.dart' show COMPILATION_UNIT_ELEMENT;
import 'package:analyzer/task/dart.dart' show LibrarySpecificUnit;
+import 'package:meta/meta.dart';
/**
* This class computes [AnalysisResult]s for Dart files.
@@ -219,6 +220,8 @@ class AnalysisDriver {
*/
Search _search;
+ AnalysisDriverTestView _testView;
+
/**
* Create a new instance of [AnalysisDriver].
*
@@ -234,6 +237,7 @@ class AnalysisDriver {
SourceFactory sourceFactory,
this._analysisOptions)
: _sourceFactory = sourceFactory.clone() {
+ _testView = new AnalysisDriverTestView(this);
_fillSalt();
_sdkBundle = sourceFactory.dartSdk.getLinkedBundle();
_fsState = new FileSystemState(
@@ -348,6 +352,9 @@ class AnalysisDriver {
*/
Stream<AnalysisStatus> get status => _statusSupport.stream;
+ @visibleForTesting
+ AnalysisDriverTestView get test => _testView;
+
/**
* Return the priority of work that the driver needs to perform.
*/
@@ -907,7 +914,11 @@ class AnalysisDriver {
// Verify all changed files one at a time.
if (_changedFiles.isNotEmpty) {
String path = _removeFirst(_changedFiles);
- _verifyApiSignature(path);
+ // If the file has not been accessed yet, we either will eventually read
+ // it later while analyzing one of the added files, or don't need it.
+ if (_fsState.knownFilePaths.contains(path)) {
+ _verifyApiSignature(path);
+ }
return;
}
@@ -1256,6 +1267,15 @@ class AnalysisDriverScheduler {
}
}
+@visibleForTesting
+class AnalysisDriverTestView {
+ final AnalysisDriver driver;
+
+ AnalysisDriverTestView(this.driver);
+
+ Set<String> get filesToAnalyze => driver._filesToAnalyze;
+}
+
/**
* The result of analyzing of a single file.
*
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698