Recognize file entry-points that should be accessed as package URIs

Users provide entry points to our tools as command line arguments. In some cases those entry points are inside a the lib directory of the package the user is working on, but are specified as file paths.
This can cause the same library file to be imported both using a file URI and a package URI, causing it to be interpreted as two different libraries.

To help users, we should vet the entry point path against its package configuration, and if the entry point could be referenced using a package URI, use that package URI as the URI of the entry-point instead.

Author: Fantashit

3 thoughts on “Recognize file entry-points that should be accessed as package URIs

  1. What does this have to do with the CFE

    My understanding of the proposal is that the CFE would automatically treat lib/some_file.dart as package:the_package/some_file.dart. This isn’t a warning to the user – it’s accepting the pattern and attempting to do what the user expects.

Comments are closed.