Open AlexJames-Dev opened 3 years ago
@AlexJames-Dev Hello there
No, this extension does not support this feature as no code parser used. Currently, you may provide autocomplete manually using this configuration
"LaravelExtraIntellisense.modelVariables": {
"booking": "App\\Models\\YourModel"
}
I am using type-hinting directly in blade templates (it worked correctly in PhpStorm), something like this:
<?php /** @var \App\Models\IpAddress $item */ ?>
<?php /** @var \App\Models\Range $range */ ?>
<div class="name">{{ $item->name }}</div>
It would be much better than defining types in configuration. And it can be parsed only with regex.
@amir9480 That would work the same as it does in PHPStorm and would be really nice. I will try using the json config provided, but I will help showing some code we are used to see in blade components. The idea like @kluvi said is to parse the PHPDoc declaration. Thanks for your time!
@php
/** @var \App\Models\Project $project */
@endphp
@forelse ($projects as $project)
<x-table.tr>
<x-table.td>{{ $project->name }}</x-table.td>
I am using type-hinting directly in blade templates (it worked correctly in PhpStorm), something like this:
<?php /** @var \App\Models\IpAddress $item */ ?> <?php /** @var \App\Models\Range $range */ ?> <div class="name">{{ $item->name }}</div>
It would be much better than defining types in configuration. And it can be parsed only with regex.
Did you install some extension to make this work? Cause I have annotations in the blade files for all variables, but neither 'jump to' nor autocomplete works for me.
Hello,
I'm not sure if this is a bug or this is not a feature of this extension, but in my blade files, when I write a variable that I have used before in the blade file, I do not get auto suggest completion for the variable. For example:
In this block of code, in an IDE like PHPStorm i would get the autocomplete in the curly braces for the $booking variable. If this is not a feature of this extension, do you know of any that provides this functionality?
Many thanks