pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Automatically added close paren isn't overwritten by manual close paren on multi-line function

Open debonte opened this issue 3 years ago • 2 comments

Environment data

  • Language Server version: 2022.1.1
  • OS and version: Windows 11 22509.rs_prerelease.211119-1136
  • Python version: 3.10
  1. Type in the following:
def foo(a: int,
        b: int)
  1. When the open paren is typed, a close paren is automatically added in front of the cursor. Keep typing...

Expected behaviour

When user types the close paren, it overwrites (or skips past?) the close paren that was added automatically. This works correctly if the function header is on a single line -- open and close parens on same line.

Actual behaviour

When user types close paren, a second close paren is created. The user needs to manually delete one of the close parens.

CloseParen

debonte avatar Jan 21 '22 20:01 debonte

@debonte auto paren is done by text mate not LSP as long as I know. probably need to move this issue to vscode that handles textmate. @judej probably know which repo we need to move any Textmate issue.

heejaechang avatar Apr 21 '22 18:04 heejaechang

I believe it's https://github.com/MagicStack/MagicPython and my impression was that transferred issues were unlikely to be fixed. So I spent some time trying to figure out how automatic parens are handled in the grammar, but didn't get anywhere.

debonte avatar Apr 21 '22 18:04 debonte

closing issue as external

judej avatar Dec 04 '22 20:12 judej