Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding/Deleting tasks via context menu does not work if multiple Diagrams are open #57

Closed
tortmayr opened this issue Apr 1, 2020 · 1 comment · Fixed by eclipse-glsp/glsp-examples#42
Assignees
Labels
bug Something isn't working workflow-example

Comments

@tortmayr
Copy link
Contributor

tortmayr commented Apr 1, 2020

The commands are sometimes executed in the wrong diagram widget.

Peek 2020-04-01 15-06

see also: https://spectrum.chat/glsp/general/trying-to-add-new-menuitemprovider~03147a72-b129-40f8-9fbc-46c63105720e

@tortmayr tortmayr added bug Something isn't working workflow-example labels Apr 1, 2020
@planger
Copy link
Member

planger commented Apr 1, 2020

Ha, good catch! This is a funny looking bug!
I looked into the code and found the reason. The TheiaContextMenuService is bound in the Theia frontend module as a singleton. That is, it will only be instantiated once in the Theia session.
Each GLSP widget will then connect once it is opened its action dispatcher to this TheiaContextMenuService. So the last one always wins.
We need to create one TheiaContextMenuService instance for each GLSP widget to which the GLSP widget is then connected.

@planger planger self-assigned this Apr 1, 2020
planger added a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Apr 1, 2020
Otherwise the last opened GLSP widget connects to the same
TheiaContextMenuService over and over again so that all context menu
actions are performed in the action dispatcher of the last widget.

To make this more convenient for clients, we provide a factory and a
function for hooking up the context menu service.

eclipse-glsp/glsp#57
planger added a commit to eclipse-glsp/glsp-examples that referenced this issue Apr 1, 2020
tortmayr pushed a commit to eclipse-glsp/glsp-theia-integration that referenced this issue Apr 15, 2020
Otherwise the last opened GLSP widget connects to the same
TheiaContextMenuService over and over again so that all context menu
actions are performed in the action dispatcher of the last widget.

To make this more convenient for clients, we provide a factory and a
function for hooking up the context menu service.

eclipse-glsp/glsp#57
tortmayr pushed a commit to eclipse-glsp/glsp-examples that referenced this issue Apr 16, 2020
tortmayr pushed a commit to eclipse-glsp/glsp-examples that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workflow-example
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants