fix(service): don't duplicate snippet's trivia when updating snippets#9051
fix(service): don't duplicate snippet's trivia when updating snippets#9051
Conversation
|
fe6f5da to
9661ff4
Compare
WalkthroughThis pull request fixes an issue where extra newlines were being added to embedded Vue Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
ematipico
left a comment
There was a problem hiding this comment.
Awesome! Good catch, that part isn't easy to handle
Summary
update_snippetswas duplicating snippets trivia. The root cause wasread_leading_triviagrabs the trivia from the original snippet. It then concatenated the leading trivia on the snippet's new code, which also contained leading whitespace. The result was duplicated whitespace. The same thing was happening to the trailing trivia as well.No changeset since this is a regression from the current
main, and it hasn't been released yet.Fixes #9050
Test Plan
snapshots
Docs