vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Placeholders for function completions

Open weeman1337 opened this issue 4 years ago • 4 comments

Feature description or problem with existing feature

Currently the language server only returns a single parameter for function completions.
For example

function test($param, $param2) {}

The completion for test is test().

Describe the solution you'd like

The current language server completion response is test($0).

Btw. $0 is the placeholder for the final cursor position according to the docs.

It would be nice if all the parameters are returned: test(${1:\$param}, ${2:\$param2})$0.

weeman1337 avatar Apr 14 '21 20:04 weeman1337

Btw. $0 is the placeholder for the final cursor position according to the docs.

This is as designed, otherwise you would get test()|

It would be nice if all the parameters are returned

I think this is down to individual preference. I'll explore adding an option for this.

bmewburn avatar Apr 14 '21 21:04 bmewburn

Maybe for an intermediate state it would make sense to change it to test($1)$0. Then the workflow would be a) complete b) type params c) jump after completion and go on with the following code.

weeman1337 avatar Apr 19 '21 17:04 weeman1337

Maybe for an intermediate state it would make sense to change it to test($1)$0

I don't see the benefit. The only difference is that you would press tab instead of ) or right arrow to get outside of the argument list.

bmewburn avatar Apr 20 '21 00:04 bmewburn

) and "right arrow" are hard to reach on my (DE) keyboard layout.

For ) I have to press shift(9) and the arrow keys are far away. Just "tabbing" provides in my opinion a better flow.

weeman1337 avatar Apr 20 '21 07:04 weeman1337