Skip to content

[Bug]: Livewire computed property type is not autocompleted in MFC #1380

Description

@aguingand

Bug description

In a Livewire MFC component, when a computed property is created, the type is not inferred inside the component class code.

Note, the autocompletion works in those other places:

  • In the MFC view
  • In SFC code / view
  • In class-based component code / view

Plugin version

13.3.1.261

Operating system

None

Steps to reproduce

Create an MFC livewire component:

php artisan make:livewire test --mfc

Put this code in resources/views/components/⚡️test/test.php file :

use Illuminate\Filesystem\Filesystem;
use Livewire\Attributes\Computed;
use Livewire\Component;

new class extends Component
{
    public function mount()
    {
        $this->filesystem->makeDirectory('test'); // filesystem methods are not autocompleted here
    }

    #[Computed]
    public function filesystem(): Filesystem
    {
        return new Filesystem();
    }
};

Result: The makeDirectory() method is not autocompleted.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions