Repository navigation
breaking a string on many lines produce incorrect result if followed by a call - #96948
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-codedom Issue DetailsFixes #91060
|
| b.Insert(0, '('); | ||
| b.Append(')'); |
There was a problem hiding this comment.
@pedrobsaila I am not expert here and do not understand how wrapping in a bracket would help, could you explain or is there a doc/reference I could check?
There was a problem hiding this comment.
The bracket forces the next function expression to be evaluated on the whole string instead of just the last substring
There was a problem hiding this comment.
I took the easy road by doing this, I could :
- improve it by doing a sort of lookup so i add the bracket to a splitted string only if it is used as argument to the next function expression but the code does not pass context information to the process of code generation
- or just stop splitting strings
If you see better solutions, let me know
There was a problem hiding this comment.
I see, thank you for explanation, I was expecting we just stop splitting strings, but I guess that is better for styling. I have no better suggestion, the fix LGTM.
I see @steveharter mentioned in the issue string concat using + when it shouldn't be doing that, not sure what else we could use other than +, but what he might have a better solution.
There was a problem hiding this comment.
I think the bracket approach is fine.
Fixes #91060