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

Whitespace changes behavior of folding @code ranges in fuse #10358

Open
ryzngard opened this issue May 9, 2024 · 2 comments · May be fixed by #10380
Open

Whitespace changes behavior of folding @code ranges in fuse #10358

ryzngard opened this issue May 9, 2024 · 2 comments · May be fixed by #10380
Assignees
Labels
area-compiler Umbrella for all compiler issues New Feature: Fuse untriaged
Milestone

Comments

@ryzngard
Copy link
Contributor

ryzngard commented May 9, 2024

In design time the parser will assign the trailing whitespace differently and ultimately causing the folding range to be different. Causing many of the CodeFoldingTests to fail due to span differences.

With Fuse

image

Without Fuse

image

@ryzngard ryzngard added area-compiler Umbrella for all compiler issues New Feature: Fuse labels May 9, 2024
@chsienki chsienki self-assigned this May 9, 2024
@chsienki chsienki added this to the 17.11 P2 milestone May 9, 2024
@chsienki chsienki linked a pull request May 17, 2024 that will close this issue
@jjonescz
Copy link
Contributor

Changing the runtime codegen would be a breaking change. Can we avoid that? What exactly does tooling need here?

@ryzngard
Copy link
Contributor Author

The problem here is I'm not sure we in tooling can tell the difference. The structure that we're looking at doesn't have an indication of leading/trailing whitespace. The FullSpan and Span are the same, I don't see anywhere in a CSharpCodeBlock doesn't have a way to tell if it's ending in a blank line in the span or not. We'd have to do text parsing which seems to be against intent here. Maybe there's another way we can strip leading/trailing whitespace? In Roslyn I would just remove the trivia but I don't think it's so simple here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-compiler Umbrella for all compiler issues New Feature: Fuse untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants