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

Formatter loses comment in the middle of an expression #1739

Open
dplassgit opened this issue Nov 21, 2024 · 1 comment
Open

Formatter loses comment in the middle of an expression #1739

dplassgit opened this issue Nov 21, 2024 · 1 comment
Assignees
Labels
dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end

Comments

@dplassgit
Copy link
Collaborator

To Reproduce
Enter this into the editor of your choice

fn broken() ->u32 {
    const x = u32:1  + // keep me
        u32:2;
    x
}

Then format it.

Expected behavior

The output is the input.

Actual behavior
The comment is deleted:

fn broken() -> u32 {
    const x = u32:1 + u32:2;
    x
}
@dplassgit dplassgit added dslx DSLX (domain specific language) implementation / front-end dslx:fmt DSLX auto-formatter labels Nov 21, 2024
@dplassgit dplassgit self-assigned this Nov 22, 2024
@dplassgit
Copy link
Collaborator Author

Similar for unary operator, cast, etc.

copybara-service bot pushed a commit that referenced this issue Nov 26, 2024
This will unlock fixing #1739

PiperOrigin-RevId: 700439097
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end
Projects
Status: In Progress
Development

No branches or pull requests

1 participant