Skip to content
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

Multiple command based on file extension #30

Open
kkankala opened this issue Sep 16, 2020 · 3 comments
Open

Multiple command based on file extension #30

kkankala opened this issue Sep 16, 2020 · 3 comments
Assignees
Labels

Comments

@kkankala
Copy link

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.

@mynkow mynkow self-assigned this Sep 21, 2020
@mynkow
Copy link
Member

mynkow commented Sep 21, 2020

@kkankala I see your point. There was a contribution about multiple commands #19

Do you want to split this into 2 different issues:

  1. Possible bug where multiple commands are not working
  2. A feature request for running specific commands based on extension.

@mynkow
Copy link
Member

mynkow commented Sep 23, 2020

@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

@kkankala
Copy link
Author

kkankala commented Sep 23, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants