Skip to content

GLSP-1531: Introduce viewport change event#438

Merged
tortmayr merged 2 commits intomasterfrom
viewport
Aug 28, 2025
Merged

GLSP-1531: Introduce viewport change event#438
tortmayr merged 2 commits intomasterfrom
viewport

Conversation

@tortmayr
Copy link
Copy Markdown
Contributor

@tortmayr tortmayr commented Aug 27, 2025

What it does

Refactor our approach to handle model changes and introduce dedicated IModelChangeService.

  • Extends the ICommandStack interface by adding an event to react to successfull command execution
  • Introduce dedicated IModelChangeService to encapsulate model change handling from the EditorContextService similar to how we do it for the selection change and the SelectionService
  • Refactor editor context, to use/forward to the model change service

In addition:

  • Clean up disposal behavior of FokusTrack

Fixes eclipse-glsp/glsp/issues/1531

How to test

For testing a logger can be configured as event listener e.g:

image

Follow-ups

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)
    Potentially breaking changes for Adopters that extend internal API:
  • GLSPCommandStack: 'notifiyListener' method has been removed
  • EditorContextSerivce:
    • Remove _modelRoot and onModelRootChangedEmitter properties. Corresponding getters now forward to the ModelChangeService
    • Remove notifyModelRootChanged method (Probably no side effect for adopters. Method was only callable from commandstack anyways)

@tortmayr
Copy link
Copy Markdown
Contributor Author

@martin-fleck-at After our offline discussion, I have now pushed a new Proposal and updated the PR description

Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall very good change, I just have a few comments and questions :-)

Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tortmayr tortmayr merged commit ab936c7 into master Aug 28, 2025
7 checks passed
@tortmayr tortmayr deleted the viewport branch August 28, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce reliable way to react to viewport changes

2 participants