Skip to content

Remove unused imports is not "across files" #57142

@FMorschel

Description

@FMorschel

I see that RemoveUnusedImport from analysis_server\lib\src\services\correction\dart\remove_unused_import.dart has the CorrectionApplicability.acrossSingleFile and this is the comment:

Bulk application is supported by a distinct import cleanup fix phase.

I had a project with multiple unused imports because I added an export. And now multiple files had this warning - a single unused import each.

VS Code problems tab had no option to fix them all at once so I ran the CLI dart fix and almost everything got fixed but my tests (I'm unsure why I could not fix anything there even though my analysis_option says nothing about ignoring them (working on a package).

What can we do about this? The above comment tells me nothing about what other phase is fixing that as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions