Closed murataksuu closed 2 years ago
Thanks @murataksuu! 👋🏼
Yep, this is the default behaviour of the extension! I'm currently working in a new feature (see #54) in which I will add a configuration option that will allow you to choose the default name to use whenever a barrel file is created.
If this new feature is not enough, I remind you that you have the promptName
configuration (see the docs). This configuration, if active, whenever you are creating a barrel file will prompt you with an input allowing you to type the name you want for the barrel file.
Aside from that, there's no other option to fix this problem. That's out of my scope, but from my point of view, I would not name the files with important content as index.dart
. But as I said, it is something I should not worry about; just a recommendation.
I will close the issue as I propose a solution in #54, since they are extremely related. Feel free to re-open if necessary! 💪🏼
Thanks for the quick response.
The promptName property works just fine. But the problem here is that the plugin changes the content without any warning. I think if the folder name and file name are the same, the extension should give a warning or ask us to enter a file name. Also, the promptName property is not enabled by default. This may cause developers to discover this feature after a bad experience.
Thank you.
Hm, true. I will think about it. If I come up with a solution I will create an issue and tag you in! 😃
If I have a file directory like this:
index/
If we don't want to enter names. Changing the contents of the index.dart file. This has been a bad experience for me. The contents of many of my files have been changed and converted to export files.