HvyIndustries / crane

PHP Intellisense/code-completion for VS Code
https://hvy.io/crane
Other
240 stars 25 forks source link

Trying to import a class expands it to its FQCN instead #379

Open JapSeyz opened 6 years ago

JapSeyz commented 6 years ago

I recently decided to try out Crane over Intelliphense, and the main difference I have noticed is that when I am trying to typehint a variable in a method declaration, it will expand the suggested class to it's FQCN instead of importing it.

EG:

public function onCharged(PaymentC $event)
{
}

Suggests the PaymentChargedEvent class as the typehint, but when I click it, the following happens:

public function onCharged(\App\Events\PaymentGateway\PaymentChargedEvent $event)
{
}

It expands the suggestion to the FQCN, instead of adding a use statement.

I have verified that the Class wasn't already added as a use statement. Is this a setting I can turn off, to set Crane to import the class instead of expanding it?

nevadascout commented 6 years ago

Unfortunately there isn't setting for this, but I have a task for Crane to automatically add a use statement when trying to use a class that's not imported.