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

Run on Save runs even when using "Save without Formatting" option in VSCode (cmd+K S) #81

Open
ilanbiala opened this issue Jul 31, 2023 · 1 comment

Comments

@ilanbiala
Copy link

I generally use the Save without Formatting option in VSCode when I have some code I'd like to avoid having the formatter modify, is it possible to pick up on this shortcut and disable Run on Save for that particular save command?

@kielmarj
Copy link

I also tried to figure out how to enable/disable the extension depending on the workbench action used to save a file, but to no avail. I'm currently using keybindings as a workaround.

// User/keybindings.json
    {
        "key": "ctrl+k d",
        "command": "extension.emeraldwalk.disableRunOnSave",
    },
    {
        "key": "ctrl+k s",
        "command": "workbench.action.files.saveWithoutFormatting"
    },
    {
        "key": "ctrl+k e",
        "command": "extension.emeraldwalk.enableRunOnSave",
    },
    {
        "key": "ctrl+s",
        "command": "workbench.action.files.save"
    }
Shortcut Command
ctrl+k d Disable Run on Save
ctrl+k s Save without formatting
ctrl+k e Enable Run on Save
ctrl+s Save file

Now that I'm used to the few extra key presses, I don't feel like this has a significant impact on my workflow efficiency. However, if anyone is aware of a better way to achieve this, let me know!

Thank you to the devs for making this extension possible. You've made my life a lot easier. It would be great to see future releases that allow for a little more flexibility in regards to different conditions like workbench action, environment, OS, etc.

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

No branches or pull requests

2 participants