emeraldwalk / vscode-runonsave

Visual Studio Code extension to run commands whenever a file is saved.
Apache License 2.0
182 stars 57 forks source link

Make VSCode "wait" until command finishes #75

Open bilogic opened 1 year ago

bilogic commented 1 year ago

Hi,

  1. I'm using this to run a formatter
  2. But often, before the formatter has completed, I have further made changes to my document
  3. Meaning, formatter will turn A to B, while I also turned A to B', so it prompts me that B' should not be saved as it will overwrite B
  4. Any possible solution for this?

Thank you.

Daviid-P commented 9 months ago

Possibly related https://github.com/emeraldwalk/vscode-runonsave/issues/82

bmingles commented 1 month ago

@bilogic any idea how long it takes for your update to run? It’s possible this is not an issue with needing a delay. It may be due to the fact that the extension does not refresh editors after save. I’ve created #103 to investigate the refresh issue. If the issue is that you have a long running command though, I’m not sure there’s really a good way to block things until it’s done.

bilogic commented 1 month ago

@bmingles from what I recall, the completion time varies because the commands are bootstrapping each time. If the formatter has a way to hold off the keystrokes until the save is completed, then there won't be a conflict to resolve.