Context manager bypasses resourceProvider when using package roots. #23909
Labels
analyzer-server
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P3
A lower priority bug or feature request
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
The code in ContextManagerImpl._computePackageUriResolver which handles package roots uses the JavaFile class to read the contents of the package root, rather than the resourceProvider. Since the resourceProvider is used during unit tests to replace the true filesystem with a mock filesystem, this means that the normal code for handling package roots is not exercised by unit tests, and a separate bogus code path (which otherwise is dead code) is used instead.
I will shortly be submitting a CL which disables the tests and eliminates the bogus code path so that I don't have to maintain it while I'm refactoring the ContextManager. But the proper solution is to add the necessary functionality to ResourceProvider so that this code path doesn't have to use JavaFile, and then re-enable the tests.
The text was updated successfully, but these errors were encountered: