Skip to content

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

Open
@FMorschel

Description

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

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-quick-fixarea-analyzerUse area-analyzer for Dart analyzer issues, including the analysis server and code completion.feature-enhanced-partsRegarding the 'enhanced-parts' featuretype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions