-
Notifications
You must be signed in to change notification settings - Fork 9
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
how to have a shortcut to barreling command for a hard-coded folder? #96
Comments
Hey @matthewkooshad, thanks for opening an issue!! I'm currently not aware of any direct solution, but obviously it would be a nice to have. AFAIK, it is possible to execute the commands from the command palette, where you can seach for The thing is that the extension would somehow need to know the path in which to generate the barrel file, which is why it has been developed to be used from the file explorer. How would you like it to work? Let's say you are editing a file in |
I also realized that I couldn't move forward using command, for what I'm looking for, which is: I would like a hard-coded path ability to use with the command, as you said currently, it is unusable without explorer interaction. So, the path is not inferred as you're suggesting, but that the path could be simply provided to the command somehow, through hard-coded config or whatever means. |
Hmm, could you provide an example with the hardcoded configuration? What about multiple folders? I have thought about creating a cli tool, as an alternative, but it would be independent from VSCode |
it doesn't matter much to me. i just want a command ability for a path. a cli tool would work too. if taking the hardcoded path approach, it could be a relative approach: since the feature is not available right now that i was curious about, should we close this thread? |
The thing is that I believe I could make it work as a CLI tool quite easily (yet not meaning that the dev time will be short, as I have little spare time to invest in OS projects). Yesterday I was thinking to maybe have an NPM package, which could either be used with Example usages I have thought: # dbfg is a shortcut for dart-barrel-file-generator 🥵
$ npx dbfg --mode nested-folders ./lib/some/path
# even maybe add the option to include multiple paths
$ dbfg --mode nested-folters ./lib/some/path ./lib/other/paths |
as i have npm, i'll be glad to report how it performs for me. it would be nice to not have to see the bubble notification that the command executed too whenever it runs -- maybe that would happen naturally if using npm to run it as you showed. also, i found i could put something like below in \AppData\Roaming\Code\User\keybindings.json (key bindings json command to open this file) to submit a command to terminal with a shortcut key:
|
Looks great. I did not know you could attach shortcuts to commands. Nonetheless, as said in other issues, I have barely time to work in this project. I will try to update it when possible. |
Answering this comment Hmm, it is strange that the My idea would be to add a new command that would only work when there's a file focused and it would allow the user to generate the barrel file for the current file parent folder, if there's any. This way, the user would be able to generate the barrel file without having to right-click a folder. What do you think? |
having to go to the explorer view, find lib folder, right click and choose the dartBarrelFileGenerator.generateCurrentWithSubfolders command from the context menu I think could be improved, if I could have a shortcut to barreling command for my lib folder. could you advise how to do that please?
The text was updated successfully, but these errors were encountered: