pucelle / vscode-run-on-save

Run configured shell commands when a file is saved in vscode, and output configured messages on status bar.
https://marketplace.visualstudio.com/items?itemName=pucelle.run-on-save
MIT License
51 stars 14 forks source link

Support for Jupyter notebooks #35

Closed gertvanhoey closed 7 months ago

gertvanhoey commented 10 months ago

Thank you for this very useful extension.

Unfortunately, onWillSaveDocument and onDocumentSaved are not triggered when saving a Jupyter notebook.

Would it be possible to provide support for running commands when saving Jupyter notebooks, making use of the following events?

https://code.visualstudio.com/updates/v1_66#_notebook-document-change-events https://code.visualstudio.com/updates/v1_77#_notebook-lifecycle-event-onwillsavenotebookdocument

gertvanhoey commented 10 months ago

By looking at the source code, I figured out that executing a command when saving a Jupyter notebook does work by specifying "commandBeforeSaving" instead of "command". Thanks again.

mfolkestad commented 9 months ago

This workaround does do the job for me, BUT it would be great if it could be implemented so that the scrip runs after I save instead of before. Now I just have to "save twice" for my intended functionality to work.

pucelle commented 7 months ago

Codes committed and will be released in coming version v1.7.1. Please check it, thanks.