-
Notifications
You must be signed in to change notification settings - Fork 30
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
GLSP-1371: Introduce event for focus changes #380
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tortmayr
force-pushed
the
tortmayr/issues/1371
branch
from
July 17, 2024 15:48
e9e2479
to
5860cb1
Compare
- Add `onFocusChanged` event to focus tracker and also expose it via EditorContextService - Update documentation on `EditorContextService`. Also expose `onSelectionChanged` event via `EditorContextService` => `EditorContextService` becomes the central component to register for (most) GLSP event listeners Part of eclipse-glsp/glsp#1371
tortmayr
force-pushed
the
tortmayr/issues/1371
branch
from
July 17, 2024 15:58
5860cb1
to
24983e5
Compare
tortmayr
added a commit
to eclipse-glsp/glsp-theia-integration
that referenced
this pull request
Jul 17, 2024
Switch from `onDidChangeActiveWidget` event to `onFoucsChanged` event for restoring the diagram selection. Reason: The `TheiaSelectionForwarder` is bound once per diagram widget. By using the `onDidChangeActiveWidget` event we notified and updated all forwarders of all widgets. As a consequence a wrong i.e. currently inactive widget could set the last selection in the selection service With using the `onFocusChanged` event we can now only update the selection if the diagram currently has focus. Requires eclipse-glsp/glsp-client#380 Fixes eclipse-glsp/glsp#1371
tortmayr
added a commit
to eclipse-glsp/glsp-theia-integration
that referenced
this pull request
Jul 17, 2024
Switch from `onDidChangeActiveWidget` event to `onFoucsChanged` event for restoring the diagram selection. Reason: The `TheiaSelectionForwarder` is bound once per diagram widget. By using the `onDidChangeActiveWidget` event we notified and updated all forwarders of all widgets. As a consequence a wrong i.e. currently inactive widget could set the last selection in the selection service With using the `onFocusChanged` event we can now only update the selection if the diagram currently has focus. Requires eclipse-glsp/glsp-client#380 Fixes eclipse-glsp/glsp#1371
2 tasks
tortmayr
added a commit
to eclipse-glsp/glsp-theia-integration
that referenced
this pull request
Jul 17, 2024
Switch from `onDidChangeActiveWidget` event to `onFoucsChanged` event for restoring the diagram selection. Reason: The `TheiaSelectionForwarder` is bound once per diagram widget. By using the `onDidChangeActiveWidget` event we notified and updated all forwarders of all widgets. As a consequence a wrong i.e. currently inactive widget could set the last selection in the selection service With using the `onFocusChanged` event we can now only update the selection if the diagram currently has focus. Requires eclipse-glsp/glsp-client#380 Fixes eclipse-glsp/glsp#1371
ndoschek
approved these changes
Jul 17, 2024
tortmayr
added a commit
to eclipse-glsp/glsp-theia-integration
that referenced
this pull request
Jul 17, 2024
Switch from `onDidChangeActiveWidget` event to `onFoucsChanged` event for restoring the diagram selection. Reason: The `TheiaSelectionForwarder` is bound once per diagram widget. By using the `onDidChangeActiveWidget` event we notified and updated all forwarders of all widgets. As a consequence a wrong i.e. currently inactive widget could set the last selection in the selection service With using the `onFocusChanged` event we can now only update the selection if the diagram currently has focus. Requires eclipse-glsp/glsp-client#380 Fixes eclipse-glsp/glsp#1371
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
onFocusChanged
event to focus tracker and also expose it via EditorContextServiceEditorContextService
. Also exposeonSelectionChanged
event viaEditorContextService
=>EditorContextService
becomes the central component to register for (most) GLSP event listeners Theia selection forwarder not working when switching between tabs glsp#1371How to test
Follow-ups
Changelog