Closed maxpill closed 2 years ago
Yes indeed! You will want to check out the stand-alone version here: https://github.com/gmlewis/go-flutter-stylizer
I actually tried it - it worked well. Nevertheless it would be nice to have a possibility to run it on all files via VS Code extension in example with a command. I can make a PR in my free time if you like :)
I actually tried it - it worked well. Nevertheless it would be nice to have a possibility to run it on all files via VS Code extension in example with a command. I can make a PR in my free time if you like :)
Yes, a PR would be great, thank you!
@gmlewis @maxpill
I read this stack overflow: https://stackoverflow.com/questions/43666270/how-do-i-format-all-files-in-a-visual-studio-code-project
Scroll down to this part of the thread.
This recommends this extension Command on All Files
I followed the stack overflow and set up my settings.json to format all .dart files in my project.
"commandOnAllFiles.commands": {
"Format File": {
"command": "editor.action.formatDocument",
"includeFileExtensions": [
".dart"
]
}
}
@gmlewis - extension may allow your users to run your command on all files.
The above command that runs is editor.action.formatDocument
What is your command? If you reply here, I'll set it up and give it a try.
Best regards,
Karl
Cool! Thanks, Karl, for the research.
The command should be:
"command": "extension.flutterStylizer",
@gmlewis I just found it in the source. Sorry for randomizing you. Testing on a SMALL project first. Stand by...
@gmlewis @maxpill
After installing this extension Command on All
Edit your settings.json
"commandOnAllFiles.commands": {
"Format File": {
"command": "editor.action.formatDocument",
"includeFileExtensions": [
".dart"
]
},
"Flutter Stylizer": {
"command": "extension.flutterStylizer",
"includeFileExtensions": [
".dart"
]
}
}
Run the command Flutter Stylizer
, all .dart files will be stylized!
After executing the command, wait, wait, wait, and then it will run, open every file one by one, run the command, and close the file. For large projects, take about 20 seconds to get going.
Thank you, @longtimedeveloper !
And just as a reminder to people finding this thread later, if you want a super-fast way to process all files in a very large project, please remember to check out the stand-alone command line companion tool: https://github.com/gmlewis/go-flutter-stylizer
@gmlewis I'll definitely check out go-flutter-stylizer, thank you!
Closing this issue now that the README.md file has been updated to include this solution provided by @longtimedeveloper . Thank you, @longtimedeveloper !
Hello, is there a possibility to stylize all files in a given directory at once? If not, it would be very nice to have a feature like this.