Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array shapes autocomplete when calling a function/method #3169

Open
alexandre-daubois opened this issue Jan 24, 2025 · 0 comments
Open

Comments

@alexandre-daubois
Copy link

alexandre-daubois commented Jan 24, 2025

Feature description or problem with existing feature

Currently, the following code doesn't provide autocomplete when calling the test() function:

**
 * @param array{
 *  name: string,
 *  age: int
 * } $myParam
 */
function test(array $myParam)
{
}

test(['name' => '...']);

Describe the solution you'd like

It would be nice to provide the same autocomplete as when dealing with $myParam inside the test function.

Additional context

Related to #3168 (and this Symfony PR), and following this comment: #249 (comment).

Jetbrains is currently working on the same feature to happen on PHPStorm : https://youtrack.jetbrains.com/issue/WI-79484/ArrayShape-and-PHPDoc-shapes-on-param-doesnt-hint-well, bringing it to VSCode also would be a real plus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants