If i have the following:
C#var foo = $"hello {string.IsNullOrEmpty(name) ? "unknown" : name}";
I then realise I need to put parentheses around the expression `string.IsNullOrEmpty(name) ? "unknown" : names
` - so I select it (expand selection CTRL-W works well…) and then invoke EmbedParentheses using Shift-9 or Shift-0 (both enabled in Options IDE\Shortcuts) 0- nothing happens.
Expected result:
C#var foo = $"hello {(string.IsNullOrEmpty(name) ? "unknown" : name)}";
I assume something in the Context is evaluating to false as it thinks the selection is inside a regular string literal.
Hi Duncan,
Thank you for the provided code snippets. I have reproduced the problem. We will try to fix the issue as soon as possible. Once we resolve the problem, we will let you know in the context of this ticket.
As a workaround, I suggest you perform steps from The Screencast
NOTE: After the above steps are performed, the "EmbedParentheses" feature is available in any code context.