Migrate missing fields to syntax editor#22261
Migrate missing fields to syntax editor#22261ChayimFriedman2 merged 6 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
4f84c19 to
dc702ae
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
dc702ae to
82c6405
Compare
| let edit = editor.finish(); | ||
| edit.new_root() | ||
| .descendants() | ||
| .find(|it| it.kind() == kind && it.text_range().start() == old_range.start()) |
There was a problem hiding this comment.
Can't we have a for the range since the editor roots things?
Also it's worth considering whether we should generalize the process of finding the mapped node to a method in the editor.
There was a problem hiding this comment.
I didn't get the first suggestion.
We can opt for range based finding on new root.
There was a problem hiding this comment.
What I was saying is that since the editor clone_subtree()s its node, the ranges won't be equal.
There was a problem hiding this comment.
We don't really need this, considering we are inserting only the new fields, it should be present in changed_elements in final edit, which we can directly use that. Added here: 8a83ee6. Tests are failing with this
There was a problem hiding this comment.
Added find_element in syntax_edit, which respects the relative positioning of the element.
8a83ee6 to
82c6405
Compare
part of #15710 and #18285