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

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

Issue 2462743003: Revert "Do nothing if [changeFile] reported, but the file content is the same." (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
« 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 443b0517a443670944260bb3be23b418e39686c4..6677376eb6194c04a09169e52b31f29eb282102f 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -208,6 +208,12 @@ class AnalysisDriver {
* "analyzing" and an analysis result is produced for every added file prior
* to the next time the analysis state transitions to "idle".
*
+ * At least one analysis result is produced for every file passed to
+ * [addFile] or [changeFile] prior to the next time the analysis state
+ * transitions to "idle", unless the file is later removed from analysis
+ * using [removeFile]. Analysis results for other files are produced only if
+ * the changes affect analysis results of other files.
+ *
* More than one result might be produced for the same file, even if the
* client does not change the state of the files.
*
@@ -299,11 +305,6 @@ class AnalysisDriver {
* The [path] must be absolute and normalized.
*
* The results of analysis are eventually produced by the [results] stream.
- *
- * Causes the analysis state to transition to "analyzing" (if it is not in
- * that state already). At least one analysis result will be produced the
- * file prior to the next time the analysis state transitions to "idle",
- * unless the file is later removed from analysis using [removeFile].
*/
void addFile(String path) {
_explicitFiles.add(path);
@@ -325,11 +326,6 @@ class AnalysisDriver {
* into the current file state prior to the next time the analysis state
* transitions to "idle".
*
- * If the file content is the same, no new results will be produced because
- * of this notification, including no result for the file itself. Otherwise,
- * one or more results will be produced - for the file itself and other
- * files that that change in the file might affect.
- *
* Invocation of this method will not prevent a [Future] returned from
* [getResult] from completing with a result, but the result is not
* guaranteed to be consistent with the new current file state after this
@@ -685,22 +681,16 @@ class AnalysisDriver {
*/
void _verifyApiSignatureOfChangedFile(String path) {
_logger.run('Verify API signature of $path', () {
- String oldContentHash = _fileContentHashMap[path];
String oldSignature = _fileApiSignatureMap[path];
// Compute the new API signature.
// _File.forResolution() also updates the content hash in the cache.
Source source = _sourceForPath(path);
_File newFile = new _File.forResolution(this, source);
- // If the file content hash is the same, we don't need analyzing it.
- if (newFile.contentHash == oldContentHash) {
- _filesToAnalyze.remove(path);
- return;
- }
+ String newSignature = newFile.unlinked.apiSignature;
// If the old API signature is not null, then the file was used to
// compute at least one dependency signature. If the new API signature
// is different, then potentially all dependency signatures and
// resolution results are invalid.
- String newSignature = newFile.unlinked.apiSignature;
if (oldSignature != null && oldSignature != newSignature) {
_logger.writeln('API signatures mismatch found for $newFile');
_dependencySignatureMap.clear();
« 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