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

Delete matching closing bracket even if it is lower in the file #127101

Closed
dimaxiton1 opened this issue Jun 24, 2021 · 10 comments
Closed

Delete matching closing bracket even if it is lower in the file #127101

dimaxiton1 opened this issue Jun 24, 2021 · 10 comments
Labels
editor-autoclosing Editor automatic closing of parens / brackets / etc. feature-request Request for new features or functionality

Comments

@dimaxiton1
Copy link

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.57.1
  • OS Version: macOS 10.15.5

Steps to Reproduce:

  1. Create empty js/ts file
  2. Write [] () {} brackets. Try to close the opening one.

Please make the same behavior that is using WebStorm: to always close any matching bracket, just because it is extremely convenient. Like seriously, I don't have time to close the matching bracket, especially in very complicated TS file, where I have multiple interfaces. Please make that behaviour to work out of the box. I believe that the future in your hands, you're building the amazing IDE, thank you VSCode guys!

@vscodebot
Copy link

vscodebot bot commented Jun 24, 2021

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

@ArturoDent
Copy link

What is your Editor: Auto Closing Delete setting? You may prefer always.

@bpasero bpasero assigned bpasero and alexdima and unassigned bpasero Jun 25, 2021
@zardoy
Copy link
Contributor

zardoy commented Jun 25, 2021

@ArturoDent It seems that this setting doesn’t work as expected.

Just try to move the bracket to another line. Then move the cursor back to opening one and you will see that it won’t delete the closing bracket.

@dimaxiton1
Copy link
Author

bump :)

@dimaxiton1 dimaxiton1 changed the title [editor] **Always** auto close matching brackets [editor] Always auto close matching brackets Jun 28, 2021
@alexdima
Copy link
Member

@dimaxiton1 What are the steps to reproduce the problem? If I open a blank TS file in a default VS Code installation and type (, then the closing ) auto-closes for me.

@alexdima alexdima added the info-needed Issue requires more information from poster label Jun 28, 2021
@zardoy
Copy link
Contributor

zardoy commented Jul 3, 2021

Sorry for the latency here. Here is some demos on clean Insiders build:

Default VS Code installation (before setting the "editor.autoClosingDelete": "always"):

brackets-demo

So my proposal here is to make VS Code always remove the closing bracket out of the box. This should better align with other editors (WebStorm, Xcode etc).

Also I missing a setting that would always remove the closing bracket (even if it on another line).

brackets-demo

This should better align with WebStorm defaults.


I hope I made it clear.

@alexdima
Copy link
Member

alexdima commented Jul 5, 2021

Thank you @zardoy for the extra explanation.

On the first GIF, when pressing (, the editor auto-inserts ). The ) is marked temporarily as "auto-inserted". Once the cursor leaves the area (I think you press arrow right and the cursor goes after the automatically inserted )), the editor considers that you have accepted the auto-inserted ) (i.e. you have interacted with it), so it considers it committed, so it will no longer delete it when pressing backspace. I think you can get the behaviour you want in the first GIF using "editor.autoClosingDelete": "always"

On the second GIF, we never implemented something like that. i.e. delete matching closing bracket at distance. We only ever implemented deleting the matching closing bracket when the brackets touch. We can use this issue to track this feature request.

@alexdima alexdima changed the title [editor] Always auto close matching brackets Delete matching closing bracket even if it is lower in the file Jul 5, 2021
@alexdima alexdima added editor-autoclosing Editor automatic closing of parens / brackets / etc. feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Jul 5, 2021
@alexdima alexdima removed their assignment Jul 5, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2021
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
Projects
None yet
Development

No branches or pull requests

6 participants
@bpasero @alexdima @dimaxiton1 @ArturoDent @zardoy and others