Not working.
ThatOneRockyBoy opened this issue · 1 comments
These are not cases ide-helper handles (or was designed to handle) 🤷🏼 I suggest to read the docs to get a better idea.
I'm not using vscode, but I can give you some suggestions what might work:
In the first one you likely can help yourself, I've two suggestion:
- Use phpdoc on the
handle
method and document what the closure accepts/returns:/** * @param Request $request * @param Closure(Request):Response $next */ public function handle(Request $request, Closure $next): Response {
- if vscode does not support Closure descriptions like this, you can try assigning it to a temporary variable and add a phpdoc:
/** @var Response $result */ $result = $next($request);
In the second example, Laravel documents $this->app
as \Illuminate\Contracts\Foundation\Application
, but isLocal
is from the concrete class which implements the interface, this one here https://github.com/laravel/framework/blob/c1569099594168870cb4bdabfbaa35e5d172310b/src/Illuminate/Foundation/Application.php#L666-L669
At least in phpstorm, once you wrote isLocal()
it infers it (and does not underline it)
The yolo
one is made up, isLocal
shows no indicator and you can also jump to source here.
But alas, phpstorm does not provide autocomplete to it per se. However, the github copilot will certainly suggest it 😅
I'm not ware if vscode supports stubbing for those or even how to write them, phpstorm supports the meta file format but I could not see either aspects being supported.