Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension not working on parted files #49

Open
adnanjpg opened this issue Nov 23, 2022 · 3 comments
Open

extension not working on parted files #49

adnanjpg opened this issue Nov 23, 2022 · 3 comments

Comments

@adnanjpg
Copy link

adnanjpg commented Nov 23, 2022

Hey there,

In my app I am using json_serializable and freezed.

So if I have a freezed and/or json serialized class A in a.dart file, I have to add part 'a.freezed.dart and/or a.g.dart to the head of the files. In such files (a.dart) this extension does not fix the import statement.

a.dart:
import 'package:my_app/my_file.dart';

part 'a.g.dart';
part 'a.freezed.dart';

@freezed
class A {
...
@adnanjpg
Copy link
Author

I had only the parted files not fixing imports so I thought this was the root of the problem, when I tried to reproduce this in an empty project I did not have this problem.

So I want back to my main project and tried making a package import in another files and some of them actually did not fix their imports.

I also though that this had to do with the depth of the files, so again I tried to reproduce that in the empty project, still worked like a charm.

At this point I have no idea what's causing this in my main project, I'll come back when I have more clues.

@adnanjpg
Copy link
Author

Figured it out, apparently this extension will not work when you have a comment above the import statements. In my case, I had an 'ignore for file' (e.g. // ignore_for_file: constant_identifier_names) statement.

@adnanjpg
Copy link
Author

Related #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant