Skip to content

Create new file quick fix for enhanced part always uses the main file name #59708

Open
@FMorschel

Description

@FMorschel

Create main.dart:

part 'part.dart';

Then trigger the quick-fix to create the part.dart file.

Inside part.dart:

part of 'main.dart';

part 'inner-part.dart';

Do the same for the new file, it'll give a new error:

Expected this library to be part of 'package:bug/part.dart', not 'package:bug/inner-part.dart'.
Try including a different part, or changing the name of the library in the part's part-of directive.dart[part_of_different_library](https://dart.dev/diagnostics/part_of_different_library)

Because the generated inner-part:

part of 'main.dart';

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixesfeature-enhanced-partsRegarding the 'enhanced-parts' featuretype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions