Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid auto-overtype on closing quotes when preceded by an escape character (backslash) #53357

Closed
axefrog opened this issue Jun 29, 2018 · 2 comments
Assignees
Labels
editor-autoclosing Editor automatic closing of parens / brackets / etc. feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@axefrog
Copy link

axefrog commented Jun 29, 2018

Just a small thing, but VS Code's standard, mostly-helpful feature of automatically overtyping when closing different kinds of pairs (braces, quotes, etc.) is an annoyance when typing strings that contain escaped quotes. Given that the editor seems to recognise escape characters, it'd be good if a preceding escape character could prevent overtype from being triggered.

2018-06-30_05-55-11

@vscodebot vscodebot bot added editor editor-autoclosing Editor automatic closing of parens / brackets / etc. labels Jun 29, 2018
@alexdima alexdima added feature-request Request for new features or functionality and removed editor labels Jul 2, 2018
@alexdima alexdima removed their assignment Aug 8, 2019
@alexdima alexdima added this to the Backlog milestone Aug 8, 2019
@alexdima alexdima self-assigned this Oct 16, 2019
@alexdima alexdima modified the milestones: Backlog, October 2019 Oct 16, 2019
@alexdima alexdima added the verification-needed Verification of issue is requested label Oct 28, 2019
@connor4312
Copy link
Member

First of all, thanks for the fix, this has been a grain of sand in my shoe for a couple years and I'm so happy to see it resolved 😄

I did run into some edge cases while testing this. If a backslash is escaped, we may still want to over-type the quoting character, typing the sequence 'hello\\' yields 'hello\\''. It might make sense to detect this, as languages that use backslash as an escape character all (as far as I know) use it to escape itself.

In C# verbatim string literals the backslash does not operate as an escape sequence, so var foo = @"hello\"; is valid--general language awareness is something that's not present in this change list, I'm sure there's also languages that use other means to escape characters. I realize this might be out of scope, I wanted to mention it for thoroughness.

I'll assign to 'steps needed' pending your thoughts on this. If you think these two cases are out of scope for the feature, feel free mark it verified.

@connor4312 connor4312 added verification-steps-needed Steps to verify are needed for verification verification-needed Verification of issue is requested and removed verification-needed Verification of issue is requested labels Oct 29, 2019
@alexdima
Copy link
Member

I would leave this as it is, I agree that ending a string with a backslash is not covered, but I also think that is even more rare... :-)

@alexdima alexdima added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels Oct 30, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-autoclosing Editor automatic closing of parens / brackets / etc. feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants