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

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

Issue 2450183004: More tests and a few fixed for the driver. (Closed)
Patch Set: Created 4 years, 2 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
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 599d0c9eb6a32c699ea47260e007e973e858e608..69040333d01abc4676dcaa56bd2e359b3c2bd133 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -259,6 +259,7 @@ class AnalysisDriver {
bool analyzed = false;
for (String path in _priorityFiles) {
if (_filesToAnalyze.remove(path)) {
+ analyzed = true;
AnalysisResult result =
_computeAnalysisResult(path, withUnit: true);
yield result;
@@ -331,7 +332,9 @@ class AnalysisDriver {
*/
void changeFile(String path) {
_changedFiles.add(path);
- _filesToAnalyze.add(path);
+ if (_explicitFiles.contains(path)) {
+ _filesToAnalyze.add(path);
+ }
_transitionToAnalyzing();
_hasWork.notify();
}
@@ -472,6 +475,7 @@ class AnalysisDriver {
AnalysisContext _createAnalysisContext(_LibraryContext libraryContext) {
AnalysisContextImpl analysisContext =
AnalysisEngine.instance.createAnalysisContext();
+ analysisContext.analysisOptions = _analysisOptions;
analysisContext.sourceFactory =
new SourceFactory((_sourceFactory as SourceFactoryImpl).resolvers);
@@ -941,7 +945,7 @@ class _File {
List<int> bytes = driver._byteStore.get(key);
if (bytes != null) {
PackageBundle unlinked = new PackageBundle.fromBuffer(bytes);
- driver._fileApiSignatureMap[path] = unlinked.apiSignature;
+ _updateApiSignature(driver, path, unlinked.apiSignature);
return new _File._(driver, source, null, contentHash, unlinked, null);
}
}
@@ -972,7 +976,7 @@ class _File {
});
}
unlinked = new PackageBundle.fromBuffer(bytes);
- driver._fileApiSignatureMap[path] = unlinked.apiSignature;
+ _updateApiSignature(driver, path, unlinked.apiSignature);
}
// Return the full file.
return new _File._(driver, source, content, contentHash, unlinked, unit);
@@ -1021,6 +1025,15 @@ class _File {
unit.lineInfo = lineInfo;
return unit;
}
+
+ static void _updateApiSignature(
+ AnalysisDriver driver, String path, String newSignature) {
+ String oldSignature = driver._fileApiSignatureMap[path];
+ if (oldSignature != null && oldSignature != newSignature) {
+ driver._dependencySignatureMap.clear();
+ }
+ driver._fileApiSignatureMap[path] = newSignature;
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698