-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[analyzer] Provide a ResourceProvider
that takes a FileSystem
from the file package
#56563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Summary: The user wants to use the |
I wouldn't have any problem adding a dependency on the But a more interesting question might be whether we could replace our use of |
I like the idea of eliminating It seems like #56404 might also eventually provide a good replacement, but maybe that replacement is the In the meantime (the low level I/O issue is likely to take a while to resolve), I'll see what it would take to eliminate |
Thanks for the link to #56404. I find this comment to be a bit concerning: #56404 (comment). I think I'd want it to be fully supported before switching to it. @devoncarew Can you comment on the status of the |
OK, I took a look. Yeah, from an architectural standpoint, it might be worthwhile to remove Each of the functions on So, overall, if you have a lot of developer cycles going to waste somewhere, they would be well used in the conversion, but since that is highly unlikely, I think the small effort required to write a |
It's not maintained by the Dart team, though members have updated it past breaking dart:io changes; the last word on it was "only supporting this for the extent needed for the flutter_tool itself; anything else is best effort for now". |
Given that we authored |
Here's a PR with a proposed wrapper: https://dart-review.googlesource.com/c/sdk/+/382243 |
Description
In the Dart Analyzer's API, the
parseFile
method takes aResourceProvider
object. In the rest of my app, I'm using the Dartfile
package to be able to replace theLocalFileSystem
with aMemoryFileSystem
during testing.The
ResourceProvider
API has a similar mechanism that lets me use aMemoryResourceProvider
, but what I really want is to just have a regularResourceProvider
that takes aFileSystem
so I can just spoof the filesystem in one place, because using two means they are independent memory file systems that I have to keep in sync in my tests.There doesn't appear to be a version of
ResourceProvider
that takes aFileSystem
, but it doesn't look too hard to make one.Could we provide one? Or, at least, would a PR that created one be considered, seeing as how it would probably add a dependency on the
file
package? Alternatively, thefile
package could provide aResourceProvider
, but it's much more widely used than the analyzer package, and would add a dependency on the analyzer.The text was updated successfully, but these errors were encountered: