You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
REGRESSION: closing parenthesis typed inside arguments of autocompleted function call does not overwrite/jump the existing closing parenthesis #947
<?php
class Whatever {
protected function doSomething($x) {
echo $x;
}
protected function bar() {
// We are going to add code here below:
}
}
Place the cursor at the end of (inside) the bar() function, below the comment.
Start typing:
$this->doSome
Accept the autocomplete suggestion for doSomething() by either clicking on it or using the Enter or Tab key.
Type 123 as the argument for the function:
The cursor is now before the closing parenthesis
Type )
Expected behavior
The closing parenthesis that you type should "overwrite" the already existing closing parenthesis, and now you should have only one closing parenthesis (which was already there) and the cursor should now be after the closing parenthesis
Observed behavior
This:
The ) you typed is added inside the existing (), as if you were typing in a simple agnostic plain text editor that knows nothing about code.
No, I don't want to have to type the opening ( myself.
I expect it to understand that, if I am inside and at the end of a (), and I type an extra unmatched ), it is meant to be the closing ) that is already there and "jump" it, exactly as it does when I have typed the ( myself (and if I wanted to purposefully write an extra syntactically incorrect ) for whatever reason, i can always add it after instead of before). In other words, it shouldn't matter whether I typed the ( myself (which also results in the ) being automatically added) or it was inserted by autocomplete. What the IDE does should always only depend on the code that is there and the position I'm at, regardless of the history of how I got there.
I never touched that setting and I've always had the () inserted automatically when it autocompletes a function name (which is what I want), and I'm pretty sure it used to behave as I expect until recently, otherwise I couldn't possibly be noticing it only now.
Activity
jakubmisek commentedon Nov 21, 2025
Please check the setting
"php.completion.parameters", you may want to set it tonone.parametersandparenthesesinsert a snippet, so you finish it by pressingTAB.noneoption lets you to type(and), and tracks the closing bracket:php4fan commentedon Nov 21, 2025
No, I don't want to have to type the opening
(myself.I expect it to understand that, if I am inside and at the end of a
(), and I type an extra unmatched), it is meant to be the closing)that is already there and "jump" it, exactly as it does when I have typed the(myself (and if I wanted to purposefully write an extra syntactically incorrect)for whatever reason, i can always add it after instead of before). In other words, it shouldn't matter whether I typed the(myself (which also results in the)being automatically added) or it was inserted by autocomplete. What the IDE does should always only depend on the code that is there and the position I'm at, regardless of the history of how I got there.I never touched that setting and I've always had the
()inserted automatically when it autocompletes a function name (which is what I want), and I'm pretty sure it used to behave as I expect until recently, otherwise I couldn't possibly be noticing it only now.jakubmisek commentedon Nov 22, 2025
I see, you are right, there was a minor change that breaks the
autofunction of VSCode'seditor.autoClosingOvertypesetting.We'll prepare a pre-release with the fix.