Skip to content

Consider a static code check for the @GenerateMocks annotation before resolving the libraryΒ #503

Open
@evanweible-wf

Description

@evanweible-wf

Related to #502 and dart-lang/build#3238. Currently, the mock builder is implemented in such a way that it fully resolves every Dart library. Given that this builder also currently runs on all .dart files by default, this results in a significant performance hit, especially for large projects, and especially considering that this builder won't generate any code for most of its inputs.

Consumers can narrow down the inputs to this builder, but it would be nice to improve the performance of this builder by default. One option to do so would be to perform a check for the presence of a @GenerateMocks annotation in the source file's text before using the builder API/analyzer to resolve that library. Even if the check produced false-positives (for example, finding it in a comment), it would better than resolving every library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work ontype-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