Content Model: Add model into ContentChangedEvent #2076
Merged
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.
In order to prepare for cached model, we need to include content model in ContentChangedEvent, so that plugin can get the latest model which causes this change.
In this change I add a new event interface
ContentModelContenetChangedEvent
, with two new properties:Then let editor API
setContentModel
returns the new rangeEx which is already returned from its underlying core API.Finally, I modified
formatWithContentModel
to let it triggerContentModelContentChangedEvent
with the latest content model and range ex.Currently these results are not used, but later I'll add another change that will read this result and cache it.