Skip to content

Parentheses swallowing does not work when parentheses are inserted by autocomplete #78975

@ghost

Description

Version: 1.37.0
Commit: 036a6b1
Date: 2019-08-08T01:24:14.598Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.2.7-100.fc29.x86_64

Steps to Reproduce:

  1. Create a new Java file.
  2. Write a basic main function.
  3. Inside the main function, start typing 'main' and use autocomplete to expand it to main(args).
  4. Type in an argument, then type in a closing parenthesis.
  5. Instead of the expected behavior of swallowing the last parenthesis, an extra parenthesis will be inserted.

Does this issue occur when all extensions are disabled?: No, because the default autocomplete does not understand function calls without the use of an extension, and therefore does not insert any parentheses. See above following comment about the Javascript extension.

The incorrect behavior is exhibited with any extension that provides autocomplete which inserts parentheses when autocompleting a function call. For example, I also tested this bug on Rust and Javascript code, using their respective extensions. The bug shows up with Rust but not with Javascript, because the latter requires the user to type the parentheses themselves, which correctly trigger parenthesis swallowing.

Behavior in Java:
output
(Same problem with Rust.)

Behavior in Javascript:
output(1)
(This behavior is also displayed when extensions are disabled, as the basic autocomplete does not insert parentheses, similar to the Javascript autocomplete.)

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugeditor-autoclosingEditor automatic closing of parens / brackets / etc.verifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions