pylance-release
pylance-release copied to clipboard
Automatically added close paren isn't overwritten by manual close paren on multi-line function
Environment data
- Language Server version: 2022.1.1
- OS and version: Windows 11 22509.rs_prerelease.211119-1136
- Python version: 3.10
- Type in the following:
def foo(a: int,
b: int)
- 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.

@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.
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.
closing issue as external