-
Notifications
You must be signed in to change notification settings - Fork 789
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
Parens: ${(…; …)}
& multiline expr handling
#16666
Conversation
❗ Release notes required
|
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.
For an internal module, this is exceptionally well detailed API description, thank you
Hey, how do I repro this? Tried the code and it does not cause any issues? |
With an extension built from the current $"{((); ())}" let _ =
let x = 3
(
let y = 99
y - x
) but the resulting code will be invalid. |
It's just a copy of the docs for the public |
My bad, didn't have it enabled, thanks for explaining :) |
Great stuff, as usual :) |
* The logic in dotnet#16666 addressed some multiline parentheses removal issues, but it was slightly too aggressive and sometimes shifted lines farther than was necessary or safe.
* Shift paren contents less aggressively * The logic in #16666 addressed some multiline parentheses removal issues, but it was slightly too aggressive and sometimes shifted lines farther than was necessary or safe. * Update release notes --------- Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com>
Another followup to #16079.
Description
Keep parens around sequential exprs in interpolated strings.
Source
$"{((); ())}"
Before
After
$"{((); ())}"
Handle more multiline parenthesization scenarios.
The snipping tool is not working for me right now for some reason, but here is an example of the kind of multiline parenthesized expression that is now handled correctly:
Source
Before
After
I also introduced some new logic to handle scenarios like the following, where removing the parentheses would result in outer bindings being shadowed, e.g.:
Trim extra whitespace between the parens and the inner constructs, e.g.:
→
Checklist
Notes
@nojaf I moved the innards of the
ParsedInput
module from #16462 into aSyntaxNodes
module, exposed only internally for now. TheParsedInput
module now simply delegates to that.bba8e2a shows an example of the "composability" that I was trying to gesture at before.