vs-code-bpmn-io
vs-code-bpmn-io copied to clipboard
Menu action File -> Save does not do anything
Describe the Bug
Using the VS Code menu action Save
is not doing anything.
Steps to Reproduce
- Make changes in a diagram
- Execute menu action
File
->Save
- See no saving action is triggered (missing loading circle in the editor)
Expected Behavior
Menu action save
should execute saving the diagram. That's the behavior we currently have bound to the keyboard shortcut itself, but not to the menu action.
One idea could be to hook into the save command of VS Code, but seems like this in not supported as for now: https://github.com/Microsoft/vscode/issues/1431#issuecomment-561191204
Environment
- OS: MacOS 10.15
- Library version: 0.9
Original Message
When changing the diagram in the visual editor changes are not made to the XML file
Closing the diagram editor then re-opening from the XML just displays the ORIGINAL diagram
I just waisted 4 hours on this
I'm sorry to hear that. Diagram changes will not be saved automatically but will be saved once
- you press CTRL/CMD + S
- you on-focus and focus the editor, in case you have configured
files.autoSave
inside VSCode settings
Unfortunately, saving the file when the editor closes is currently not possible due to restrictions of the WebView API. cf. https://github.com/bpmn-io/vs-code-bpmn-io/issues/71#issuecomment-637543431
Did you one of those? What other save actions would you expect?
Please also make sure you use our issue template to make it easier for us to help you.
I selected Save from the menu and I always have Auto Save enabled
I selected Save from the menu
Thanks for sharing this. Using the menu action seems to be indeed uncovered currently. We currently only listen for CMD/CTRL + S
keyboard actions inside the editor, however, not reacting to the menu action itself.
I'll update the issue accordingly.
Even ctrl+s does not work for me. Pretty useless editor plugin if you can edit but cannot save.
I investigated this issue a bit (making the menu actions working / disabled).
Result: there is no easy fix. Since the editor is a simple WebView, there is no real save action. We would have to create a native editor to make the menu working (https://github.com/bpmn-io/vs-code-bpmn-io/issues/67).
Also, hooking into commands is not possible at the moment. Interesting: it was removed as an experimental feature some while ago: https://github.com/microsoft/vscode/issues/1431#issuecomment-561191204).
Therefore, the keyboard bindings (CMD/CTRL+S) are the only way to trigger save at the moment inside the BPMN editor. I verified that this works on multiple operating systems (Windows CTRL+S
, Mac CMD+S
).