Peekmo / atom-autocomplete-php

Autocomplete for PHP in atom editor
MIT License
136 stars 34 forks source link

Type inference of allocations are not working when using full namespace #250

Closed iluuu1994 closed 8 years ago

iluuu1994 commented 8 years ago

Local variables that are initialized with a newly allocated instance using its full namespace don't work for me.

$bar = new \Foo\Bar();
$bar->{???}

Any idea what's going on here?
Adding a PHPDoc or using a use statement and then initializing using new Bar() fixes the issue.

/** @var \Foo\Bar */
$bar = new \Foo\Bar();
$bar->{all the stuff}

// or

use \Foo\Bar;
$bar = new Bar();
$bar->{all the stuff}
iluuu1994 commented 8 years ago

The description of my issue is actually incorrect, this ONLY happens when the first character of the namespace is a lowercase character. I'll create a pull request shortly to fix this.