Analyzer: deleting a file changes query results #50688
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
TL;DR Deleting a file can cause "find all implementations" query to reduce the number of results (and probably other stuff too).
Reproduction (example):
pkg/_fe_analyzer_shared
in an editor.lib/src/parser/listener.dart
.Listener
issue a "Find all implementations" query.19 results in 16 files
, among them results fromfront_end
andanalyzer
.touch pkg/_fe_analyzer_shared/lib/x.dart ; sleep 3; rm pkg/_fe_analyzer_shared/lib/x.dart
Listener
issue a "Find all implementations" query again.9 results in 6 files
, all in_fe_analyzer_shared
.What happens is, that on the initial "Find all implementations" query a
discoverAvailableFiles
task is created which basically "discovers" all files in all paths mentioned in the packages file. This is why it finds results inanalyzer
andfront_end
. When deleting a file it clears "everything" (removeFile
->_clearFiles
infile_state.dart
) among it the previously discovered extra files. Issuing the "Find all implementations" query again thediscoverAvailableFiles
will not do anything as it's already completed, there will thus not be any extra files to search./cc @bwilkerson @scheglov
The text was updated successfully, but these errors were encountered: