mikededo / dartBarrelFileGenerator

VSCode extension that generates barrel files for Dart projects
MIT License
25 stars 9 forks source link

Option for default name of barrel files #54

Closed DFelten closed 2 years ago

DFelten commented 2 years ago

Could you maybe add the possibility to change the default name of a barrel file?

I would like to call each barrel file for example index.dart. Currently, a created file overwrites the existing files if they are named exactly like the folder. So index.dart is a good default for us.

mikededo commented 2 years ago

Thanks @DFelten for opening the issue 😄!

Adding an option in the user settings that allows you to always name the file differently (instead of the default <folder-name>.dart). There is currently this option that, when "on" and you create a barrel file an input appears. This is more like a one-time use case, and if you say you always use index.dart, then sure having a default is better.

As soon as I can I will get into it!

DFelten commented 2 years ago

Thanks! As far as I know The problem with the current option is that this is only working for one folder and not for nested ones.

So when adding the prompt also for nested folders would also be a great improvement.

But a default is at least for me the best solution 😃

mikededo commented 2 years ago

Oh! Thanks for pointing it out! I will address both issues as it is not the expected behaviour! 👀

mikededo commented 2 years ago

I have been revising the code, and we decided that we would not implement the custom "renaming" of files when current and nested generation was chosen (see here).

As I nobody required such feature, I decided not to implement it. However, I will add it 👍🏼

DFelten commented 2 years ago

Thanks, that would be great!

mikededo commented 2 years ago

Issue solved in #58! It will be available in the next release 🥳

mikededo commented 2 years ago

Feature added in v4.0.0 which should be life now! Thank you for your proposal, give me any feedback you can 💪🏼!

Star the project and recommend it to your fellow developers to help the extension grow 😄