Uh oh!
There was an error while loading. Please reload this page.
Parens: ${(…; …)} & multiline expr handling - #16666
Conversation
❗ Release notes required
|
T-Gro
left a comment
There was a problem hiding this comment.
For an internal module, this is exceptionally well detailed API description, thank you
abonie
commented
Feb 8, 2024
Hey, how do I repro this? Tried the code and it does not cause any issues? |
With an extension built from the current $"{((); ())}"let_=letx=3(lety=99
y - x
)but the resulting code will be invalid. |
brianrourkeboll
commented
Feb 8, 2024
It's just a copy of the docs for the public |
abonie
commented
Feb 8, 2024
My bad, didn't have it enabled, thanks for explaining :) |
psfinaki
commented
Feb 8, 2024
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
ParsedInputmodule from #16462 into aSyntaxNodesmodule, exposed only internally for now. TheParsedInputmodule now simply delegates to that.bba8e2a shows an example of the "composability" that I was trying to gesture at before.