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

Add config to use old brackets/quotes overtyping #78833

Closed
usernamehw opened this issue Aug 9, 2019 · 14 comments · Fixed by microsoft/azuredatastudio#7206
Closed

Add config to use old brackets/quotes overtyping #78833

usernamehw opened this issue Aug 9, 2019 · 14 comments · Fixed by microsoft/azuredatastudio#7206
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

@usernamehw
Copy link
Contributor

#37315

It's a breaking change. And very noticeable at that.

@vscodebot
Copy link

vscodebot bot commented Aug 9, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@alexdima
Copy link
Member

@usernamehw I've changed the editor to overtype only quotes and parens auto-inserted by the editor. Would you like to have the old behaviour of overtyping even characters that were not auto-inserted or have you maybe run into a special case in HTML/css/etc.?

@alexdima alexdima added info-needed Issue requires more information from poster editor-autoclosing Editor automatic closing of parens / brackets / etc. labels Aug 12, 2019
@usernamehw
Copy link
Contributor Author

No special cases. Old behavior.

@alexdima alexdima added this to the August 2019 milestone Aug 12, 2019
@alexdima alexdima added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Aug 12, 2019
@haymez
Copy link

haymez commented Aug 12, 2019

Obviously a lot of people requested the new behavior but I would agree with @usernamehw in that the new behavior is quite jarring and I'm a little surprised that the default behavior changed instead of a setting being added to support the new behavior for those that wanted to switch. Having the editor sometimes swallow closing tags but other times not is kinda frustrating although I can see the reasoning behind it.

@patrickodacre
Copy link

I miss the old behavior. I'm constantly deleting extra characters now =\ I'll be rolling back my version until this feature is added back. Thanks for all the hard work, folks!

@larsnystrom
Copy link

larsnystrom commented Aug 15, 2019

The problem is that not all auto-inserted brackets are considered auto-inserted in the new implementation. If I write (PHP) array_key_l and use tab to auto-expand to array_key_last() the editor inserts the parenthesis for the function and puts the cursor in between them, but typing ) won't overtype the ending parenthesis, since I auto-completed the entire function name and not just the parenthesis. The closing parenthesis is not considered auto-inserted because it was inserted as part of the function autocompletion feature and not the autoClosingBrackets feature.

This means I have to keep track of how the brackets was auto-inserted in order to know when typing a closing bracket will overwrite the auto-inserted one, or just insert a new character.

Edit: This could possibly be considered a bug, and not part of this feature request.

@gjsjohnmurray
Copy link
Contributor

The problem is that not all auto-inserted brackets are considered auto-inserted in the new implementation.

@larsnystrom this is #78975

@tabennett
Copy link

This is making this editor nearly unusable for me. The old behavior is consistent with previous editors I was using (atom, sublime text) before coming to VS Code. Pretty frustrating/jarring to have BC changes like this come though.

@rhyek
Copy link

rhyek commented Aug 20, 2019

The new behavior should've been opt-in. The way it worked before seemed more intuitive and I think most people had gotten used to it from using VSC or other editors.

@levilansing
Copy link

Agree with everyone in this issue. Frankly I'm surprised such a small collection of people were able to change the default behavior of such a standard function of the IDE. Their opinion is valid, but it's a matter of preference, not something that should have changed the default behavior for everyone else. At the very least we need an option to restore the old behavior.

In the last couple weeks I have had so much keyboard frustration that I'm on the verge of writing an extension just to restore the old behavior.

@rhyek
Copy link

rhyek commented Aug 25, 2019

How long will we have to wait for this option? Doesn't look like there's even a PR for it. Looks like it'll be at least another month to get a new version with the fix.

I really don't even understand what this change was trying to do or what the justification for it was. Previously, if you typed a closing parenthesis before an existing one and it got swallowed, the caret would now be positioned past that existing one and typing a new closing parenthesis will work and not get swallowed. Such a minor inconvenience that like 3 people in the world cared about and now it's an inconvenience for literally everyone else.

Sort of like this issue: microsoft/TypeScript#29238

I think they should make it a rule where if you are a contributor and you are introducing a feature change that alters the fundamental editing experience, code an option to disable it. You can even make it opt-out, but have the option mentioned clearly in the release notes.

@alexdima
Copy link
Member

Starting with tomorrow's Insiders build, you can use "editor.autoClosingOvertype": "always" to always type over closing quotes or brackets, even in the case of those characters that were not automatically inserted by the editor.

@julianlam
Copy link

julianlam commented Sep 5, 2019

@alexandrudima You must feel like you are stuck between a rock and a hard place with this config option!

FWIW I am a fan of the over-typing and was very confused this past week because it seemed like it worked sometimes but not all of the time, because occasionally I'll write half a conditional, fix some other line, and return to the conditional only to find my bracket overtyping no longer worked 😕 I suppose I simply got used to the overtyping, and because it was consistent, this was ok in my books. I'd still recommend "editor.autoClosingOvertype": "always" to be the default (so the behaviour remains consistent with the older version), but I understand if it is not to be.

I'll just leave this here: https://xkcd.com/1172/

@rhyek
Copy link

rhyek commented Sep 5, 2019

I agree it should default to always. Several people at my work complained about this issue, but were too busy to investigate the cause and fix. I don't believe the new option was even mentioned in the latest release notes.

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

Successfully merging a pull request may close this issue.