Skip to content

"Preview/Fix All in Workspace" and the "Fix All [in file]" LSP commands/actions do not include Pubspec fixes #64030

Closed

Description

@DanTup

If you have:

import 'package:path/path.dart' as path;

But path is not listed in the Pubspec dependencies, dart fix will fix it for you. However, the "Fix All in Workspace" command does not. Given it's called "Fix All", it probably should.

Activity

  1. added
    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
    on Aug 12, 2026
  2. self-assigned this
    on Aug 12, 2026
  3. DanTup commented on Aug 12, 2026

    @DanTup
    CollaboratorAuthor

    A related question:

    In the situation above, if I run the normal "Fix All" command/code action which applies fixes in the current file - should it also fix the Pubspec? The diagnostic is in the current file, but the fix is not.

    @bwilkerson my feeling is that it probably should. BulkFixProcessor.fixPubspec() currently enumerates all files and tries to fix them all, but we could optionally pass in a single file and only consider that one. WDYT?

  4. bwilkerson commented on Aug 13, 2026

    @bwilkerson
    Member

    I agree, it seems like "Fix All" should fix all of the diagnostics in that file even if it has to make changes in other files in order to do so.

  5. changed the title [-]"Preview/Fix All in Workspace" LSP command does not include Pubspec fixes[/-] [+]"Preview/Fix All in Workspace" and the "Fix All [in file]" LSP commands/actions do not include Pubspec fixes[/+] on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions