vs-code-bpmn-io icon indicating copy to clipboard operation
vs-code-bpmn-io copied to clipboard

Menu action File -> Save does not do anything

Open smcardle opened this issue 3 years ago • 5 comments

Describe the Bug

Using the VS Code menu action Save is not doing anything.

Kapture 2020-11-08 at 13 13 55

Steps to Reproduce

  1. Make changes in a diagram
  2. Execute menu action File -> Save
  3. 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

smcardle avatar Nov 06 '20 01:11 smcardle

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 configuredfiles.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.

pinussilvestrus avatar Nov 06 '20 08:11 pinussilvestrus

I selected Save from the menu and I always have Auto Save enabled

smcardle avatar Nov 08 '20 01:11 smcardle

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.

Kapture 2020-11-08 at 13 13 55

I'll update the issue accordingly.

pinussilvestrus avatar Nov 08 '20 12:11 pinussilvestrus

Even ctrl+s does not work for me. Pretty useless editor plugin if you can edit but cannot save.

MelvinLoos avatar Mar 01 '21 14:03 MelvinLoos

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).

pinussilvestrus avatar Apr 16 '21 10:04 pinussilvestrus