spectacles / CodeComplice

CodeIntel for Sublime Text 2 / 3
Other
167 stars 18 forks source link

Only autocomplete matching types #31

Open joehoyle opened 9 years ago

joehoyle commented 9 years ago

Given I have a function foo() that accepts a string, doing the below should only auto complete strings (or maybe there should atleast be an option to).


$bar = 123;
$foo = "123";

foo( $ ); // should only show a completion for $foo, as $bar is of type int

I tried to dig into the code to accomplish this - however I got pretty lost! It seems codeintel2 can resolve the type from a variable, for example, $a = new Query(); $a-> // will show completions from Query however in the case of autocompletions the autocompletions for current scope doesn't seem to return type information, hence the information at that point is lost.

wizza-smile commented 9 years ago

This is a scalpel level suggestion. This plugin, while not being an axe, is more like a hatchet.

ghost commented 9 years ago

:+1: for the feature. Could you implements it @wizza-smile ?