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

cant add parenthesis when cursor precedes an existing parenthesis #35799

Closed
sarora2073 opened this issue Oct 7, 2017 · 5 comments
Closed

cant add parenthesis when cursor precedes an existing parenthesis #35799

sarora2073 opened this issue Oct 7, 2017 · 5 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-autoclosing Editor automatic closing of parens / brackets / etc. feature-request Request for new features or functionality
Milestone

Comments

@sarora2073
Copy link

  • VSCode Version: Code 1.16.1 (27492b6, 2017-09-14T16:38:09.760Z)
  • OS Version: Windows_NT ia32 10.0.15063
  • Extensions:
Extension Author (truncated) Version
htmltagwrap bra 0.0.3
vscode-eslint dba 1.3.2
gitlens eam 5.4.1
beautify Hoo 1.1.1
Angular2 joh 2.7.0
debugger-for-chrome msj 3.3.1
vscode-icons rob 7.14.0

Steps to Reproduce:

  1. Open editor on a new file and enter any text with opening and closing parenthesis
    e.g. enter this code which is missing a 3rd closing parenthesis
    console.log(_.isEmpty(JSON.parse(myObject));
  2. Put cursor on any of the last 2 closing parenthesis
  3. Enter a closing parenthesis (i.e. attempt to add another parenthesis when one is already in front of the cursor).
  4. Issue: The new parenthensis is not entered (perhaps due to some code completion feature? Either way, it's obviously not useful in this common scenario)

Reproduces without extensions: Yes

@vscodebot vscodebot bot added editor editor-core Editor basic functionality labels Oct 7, 2017
@sarora2073 sarora2073 changed the title cant add parenthesis when cursor is already over an existing parenthesis cant add parenthesis when cursor precedes an existing parenthesis Oct 7, 2017
@alexdima alexdima added editor-bracket-matching Editor brace matching and removed editor-core Editor basic functionality labels Oct 9, 2017
@alexdima
Copy link
Member

alexdima commented Oct 9, 2017

This can be turned off via editor.autoClosingBrackets. The feature consists of multiple parts:

  • one is that when ( is typed, the result is (|)
  • the other part that is hit here, is that when ) is typed and ) follows the cursor, ) will be overtyped.

The feature is implemented language agnostic and looks only locally at the next character. It does not count brackets to determine if the code is "bracket unbalanced"

@alexdima alexdima added the feature-request Request for new features or functionality label Oct 9, 2017
@alexdima alexdima added this to the Backlog milestone Oct 9, 2017
@alexdima alexdima removed their assignment Oct 9, 2017
@sarora2073
Copy link
Author

Thanks for the info. I've disabled it for my purposes since it can create room for accidental bugs in the code, by not recognizing intended closing brackets when entered.

If the second scenario you described were either improved (by not being just local) or else remove the second scenario handling entirely, then the auto-close feature might be more usable. Just a thought.

@allmaxgit
Copy link

I want add parenthesis when cursor precedes an existing parenthesis.
And I want use autoClosingBrackets.

@alexdima alexdima added editor-autoclosing Editor automatic closing of parens / brackets / etc. and removed editor-bracket-matching Editor brace matching labels Oct 20, 2017
@alexdima alexdima removed the editor label Nov 23, 2017
@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jun 19, 2018

/duplicate #37315

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 19, 2018
@vscodebot
Copy link

vscodebot bot commented Jun 19, 2018

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jun 19, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) 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

4 participants