Skip to content

[analyzer] Provide a ResourceProvider that takes a FileSystem from the file package #56563

Open
@gspencergoog

Description

@gspencergoog

Description

In the Dart Analyzer's API, the parseFile method takes a ResourceProvider object. In the rest of my app, I'm using the Dart file package to be able to replace the LocalFileSystem with a MemoryFileSystem during testing.

The ResourceProvider API has a similar mechanism that lets me use a MemoryResourceProvider, but what I really want is to just have a regular ResourceProvider that takes a FileSystem 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 a FileSystem, 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, the file package could provide a ResourceProvider, but it's much more widely used than the analyzer package, and would add a dependency on the analyzer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestanalyzer-apiIssues that impact the public API of the analyzer packagearea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions