roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Typing a quote character after `new` inserts two quotes.

Open vsfeedback opened this issue 1 year ago • 2 comments

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] [regression] [worked-in:17.8] because i have to fight against it, all the time, i needed to disable the feature. Three things need to happen to make it usable, again:

  1. configure the different types of braces / quotes that should be completed automatically.
  • especially, it's crazy that this also is the checkbox for automatic quote completion - those are two different things
  1. configure whether it should trigger only at line endings / before whitespace / in all places
  • i need to CONSTANTLY delete the artifacts it creates because i am in the middle of code, adding missing quotes or parentheses - this makes it impossible to NOT look at the screen while typing, too - you never know when it sprinkles in some random characters. yay
  1. adhere to the settings for {} placing when creating the closing brace for curlies.
  • if i have them configured to be in separate lines, please put the closing one at the proper place (and put the opening one with the caret there, too, if possible.

Original Comments

Feedback Bot on 3/11/2024, 07:22 PM:

(private comment, text removed)

Alisa Qu [MSFT] on 3/13/2024, 01:16 AM:

(private comment, text removed)

Alexander Gayko on 4/2/2024, 07:04 AM:

(private comment, text removed)

Feedback Bot on 3/19/2024, 10:28 PM:

(private comment, text removed)

Alisa Qu [MSFT] on 4/2/2024, 07:39 PM:

(private comment, text removed)


Original Solutions

(no solutions)

vsfeedback avatar Jun 26 '24 03:06 vsfeedback

this is def an odd case. It's unclear to me why inserting open/quote at the same time here is bad. Presumably if a string is being written here, it's going to need its close brace. Would need the user to indicate why that's actually undesirable here.

CyrusNajmabadi avatar Jun 26 '24 03:06 CyrusNajmabadi

if i have them configured to be in separate lines, please put the closing one at the proper place (and put the opening one with the caret there, too, if possible.

Note: we don't have settings for braces to be on separate lines. What we have is a setting about where the opening and closing braces should go if it is a multi-line construct. We always allow (and attempt to preserve) braces on hte same line if that's what the user wants for a particular construct.

So our model here is to emit as {} as that allows for the latter common form. Then, if the user hits enter within that, we update the braces to be in the right location for either setting of the formatting option.

CyrusNajmabadi avatar Jun 26 '24 03:06 CyrusNajmabadi

Closing this issue as we've seen no reply to the request for more information. If you are able to get the requested information, please add it to the issue and we will retriage it.