mikededo / dartBarrelFileGenerator

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

Combined option for default file names #69

Closed PeterJ504 closed 1 year ago

PeterJ504 commented 1 year ago

Could you add on option to combine the default name and directory name for the barrel file? For instance, in the the settings directory, I'd like to automatically add settings_index.dart or settings_barrel.dart as the file.
Perhaps in the options, allow something like this: "dartBarrelFileGenerator.defaultBarrelName": "<folder-name>_barrel"

mikededo commented 1 year ago

Hi @PeterJ504!

Thanks for your proposal. What you propose seems a bit complex, as I would have to add some sort of string parsing, but I will think about it as it would allow a lot of flexibity in naming the files. I will deeply think into that.

As of now, what do you think of adding a boolean option as: "dartBarrelFileGenerator.prependFolderName": <true|false>. If the option was set to true, it would keep the name of the file with the folder extension in as a prefix (which is what you propose).
It could also be the other way around, and also add: "dartBarrelFileGenerator.prependFolderName", which would also be a boolean, and it would add it to the end of the generated name: index_settings.dart.

PeterJ504 commented 1 year ago

Your method seems to achieve the same functionality and is simpler. I approve :-)

mikededo commented 1 year ago

Good morning @PeterJ504!
New version has been published! It has your feature added! If you have any doubt or encounter any issue, please open a new issue so that I can look into it.

Thank you for your idea and patience 💯