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
50 stars 11 forks source link

Support for Jupyter notebooks #35

Closed gertvanhoey closed 6 months ago

gertvanhoey commented 8 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 8 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 7 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 6 months ago

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