language: Preserve adjacent HTML ranges while editing Markdown - #62370
Open
mTvare6 wants to merge 1 commit into
Open
language: Preserve adjacent HTML ranges while editing Markdown#62370mTvare6 wants to merge 1 commit into
mTvare6 wants to merge 1 commit into
Conversation
When updating embedded HTML ranges, a newly added range could replace an adjacent existing one if their boundaries touched. Preserve adjacent ranges and only replace ranges that actually overlap. Only replace overlapping included ranges when inserting ranges left after changed ranges have been consumed. [x, y) [y, z) != [x, z) in `splice_included_ranges`
5 tasks
Contributor
|
For context when reviewing or assigning, here is a comparison with |
This file contains hidden or 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
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.
Closes #62127
Objective
Fixes inline HTML highlighting disappearing while editing Markdown.
While updating the ranges parsed as HTML, a newly added range could replace the range immediately before it when the two touched at the same boundary number. This caused the opening tag to be dropped from the parser range until the syntax state was rebuilt.
Solution
When there are still new ranges after the changed ranges have been handled, only replace ranges that actually overlap.
This keeps adjacent HTML ranges separate instead of removing the previous one.
Testing
Added a regression for the with range like from #62127 and test testing against that.
Also verified that the incrementally parsed HTML matches a new parse and the function is source of error.
Self-Review Checklist:
Release Notes: