Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Diagnostics] Intra-group trivia not preserved when moving a node group #2850

Open
AppAppWorks opened this issue Sep 13, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@AppAppWorks
Copy link
Contributor

Description

When a Fix-it moves a group of consecutive nodes, the intra-group trivia won't be preserved,

func test() -> throws(any /**/ Error) Int
// after Fix-it
func test() throws(any Error) -> Int

It's because the nodes aren't actually "moved" when applying a Fix-it. Rather the misplaced nodes carrying the trivia are removed, and the missing nodes created by the parser (without the trivia) are presented at the designated site.

Currently trivia at the sides of a node group to move are transferred to its adjacent tokens, we should create facilities to transfer intra-group trivia from the misplaced nodes to the missing nodes.

Steps to Reproduce

No response

@AppAppWorks AppAppWorks added the bug Something isn't working label Sep 13, 2024
@ahoppen
Copy link
Member

ahoppen commented Sep 13, 2024

Synced to Apple’s issue tracker as rdar://135922636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants