-
Notifications
You must be signed in to change notification settings - Fork 420
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
Workaround Roslyn formatting bug #2051
Conversation
Due to dotnet/roslyn#50129, `FormatAsync` will give us changes past the location that we wanted if there were changes to be made on the current line. This can lead to a frustrating typing experience now that we listen for `\n` in vscode to trigger formatting. I've implemented a simple workaround for this while the bug is fixed upstream.
9e7e561
to
3d76ac8
Compare
…e newlines added are of a different flavor than the ones in the new text, add additional skipped test for incomplete declarations.
}"); | ||
} | ||
|
||
[Theory(Skip = "https://github.com/dotnet/roslyn/issues/50130")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure there's a good way to work around this one until the upstream bug is fixed.
@JoeRobich @filipw so in talking with Cyrus, he pointed out a few things:
Given those points, should we even be attempting to format on newlines at all (other than the doc comment feature)? Seems like we're trying to use a roslyn feature in a way it wasn't really intended to be used, and hitting issues because of it. |
thanks for the background info, I now understand the problem better. I like your suggestion to move |
And did you have an opinion on the format-on-newline bit? |
yes I would say for me it is acceptable for OmniSharp to only support this in targeted scenarios - like doc comments - and not have this everywhere. |
Submitted #2053 to remove the support entirely. |
Due to dotnet/roslyn#50129,
FormatAsync
will give us changes past the location that we wanted if there were changes to be made on the current line. This can lead to a frustrating typing experience now that we listen for\n
in vscode to trigger formatting. I've implemented a simple workaround for this while the bug is fixed upstream.