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.4k stars 54 forks source link

Enhancement Request: Autocomplete Suggestions Too Broad #47

Open mikebronner opened 3 years ago

mikebronner commented 3 years ago

I am seeing what I would call incorrect behavior, and am wondering if there are some settings I could implement to work around the problem. Consider the following example:

<?php

namespace Database\Factories;

use App\Models\Store;
use Illuminate\Database\Eloquent\Factories\Factory;

class StoreFactory extends Factory
{
    protected $model = Store::class;

    public function definition(): array
    {
        return [
            "address" => $this->faker->,
            "test1" => $this->faker->string,
            "test2" => $this->faker->string,
            "test3" => $this->faker->string,
            "test4" => $this->faker->string,
            "test5" => $this->faker->string,
            "test6" => $this->faker->string,
            "test7" => $this->faker->string,
        ];
    }
}

If you place your cursor at the end of the address field line, then delete the back to the greater-than, and re-type it to trigger auto-complete, it will suggest all keys listed in the array being returned. When autocompleting a variable, I would expect the autocomplete to only show items available in the variable.

amir9480 commented 3 years ago

Hi @mikebronner

Extension parses code using regexes and it's hard for me to fix bugs like this with regexes. I try.