razor icon indicating copy to clipboard operation
razor copied to clipboard

Enter closing quote doubles it

Open vsfeedback opened this issue 3 years ago • 5 comments

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


If I type backspace and remove a double quote (") and then type a double quote the editor gives me two ("")!

image


Original Comments

Feedback Bot on 10/31/2022, 07:23 PM:

(private comment, text removed)


Original Solutions

(no solutions)

vsfeedback avatar Nov 03 '22 21:11 vsfeedback

From the issue, seems like this might only happen after @bind-Value, so could be our regex in language-configuration.json needs to be updated to allow for @ signs.

davidwengier avatar Nov 03 '22 21:11 davidwengier

@davidwengier: it happens with any attribute

blimkemann avatar Nov 03 '22 21:11 blimkemann

Yep, you are correct. Looks like it only happens at the end of a line: RazorQuoteCompletion

davidwengier avatar Nov 04 '22 04:11 davidwengier

Correction, it only doesn't happen for an empty attribute that is not at the end of a line. I actually think this is behaving as designed, and it matches the behaviour of VS Code, for a plain html file, except for the one case where VS doesn't insert two quotes.

@gundermanc am I right in guessing that parity with VS Code is the aim with language-configuration.json?

davidwengier avatar Nov 04 '22 05:11 davidwengier

@veler is the expert on Language Configuration. Etienne, do you know what is the correct behavior?

gundermanc avatar Nov 04 '22 16:11 gundermanc