amir9480 / vscode-laravel-extra-intellisense

This extension adds extra autocompletion for laravel projects to VSCode.
https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.laravel-extra-intellisense
MIT License
3.5k stars 55 forks source link

Validation rules autocompletion does not work since v0.2.6 #25

Closed damiengrandi closed 4 years ago

damiengrandi commented 4 years ago

Validation rules inside controller methods aren't completed anymore. image

It works fine if I rollback to v0.2.6: image

damiengrandi commented 4 years ago

I forgot to precise I am using Laravel 7.

damiengrandi commented 4 years ago

I also tried to disable all other extensions, it didn't change anything.

amir9480 commented 4 years ago

Hello

Look like this is an issue with parentheses and regex I used. If you use this

request()->validate([...])

Or

$this->validate($request, [...])

Should work.

Gonna fix this bug as soon as I can.

damiengrandi commented 4 years ago

Hello, I confirm, it works with :

$this->validate($request, [ 'lol' => '' ]) 
$request->validate([ 'lol' => '' ])
request()->validate([ 'lol' => '' ])

But not with :

$this->validate(request(), [ 'lol' => '' ])

Also, in case some people don't use auto-closing parentheses or brackets, it does not work without the ending parenthesis ). This won't autocomplete :

$this->validate($request, [ 'lol' => ''

Nor this :

$this->validate($request, [ 'lol' => '' ]

Not sure if it's relevant to fix this one though.. But I thought it was important to precise.

amir9480 commented 4 years ago

@damiengrandi

Please update to version 0.3.3. If this issue still exists let me know.