VSE-FormatDocumentOnSave
VSE-FormatDocumentOnSave copied to clipboard
Multiple command based on file extension
Hi, This is more of a question than an Issue.
Does the current configuration support running multiple commands based on extension.
I want to run command A and Command B when file is *.cs and Command B and Command C when file is *.js.
[.] command = Edit.FormatDocument EditorContextMenus.CodeWindow.RemoveAndSort EditorContextMenus.CodeWindow.MakePrettier allowed_extensions = .cs .js denied_extensions = .*
But this is making save in endless loop.
@kkankala I see your point. There was a contribution about multiple commands #19
Do you want to split this into 2 different issues:
- Possible bug where multiple commands are not working
- A feature request for running specific commands based on extension.
@kkankala I am not sure what the command EditorContextMenus.CodeWindow.MakePrettier
actually is but I think the problem is there. To verify you could try this:
- Open command window (View => Other Windows => Command Window)
- Execute the commands in the same order you have them configured in the extension
Keep in mind that the extension is not doing magic. It invokes the commands in a sequence.
I tested your scenario and it is working for me. Let me know if you have questions
looks like if "EditorContextMenus.CodeWindow.MakePrettier" is at the end, then it will be in loop of unsaved document. If I have prettier command first, then document is not formatted properly. it might be clashing with javascript Prettier extension.
@mynkow , can you still look into feature request of running commands based on extension?
Thanks for the response.