alienhard / SublimeAllAutocomplete

Extend Sublime autocompletion to find matches in all open files of the current window
917 stars 110 forks source link

Overrides php function autocomplete #15

Closed Relequestual closed 11 years ago

Relequestual commented 11 years ago

It would seem this plugin overrides php autocomplete from CodeIntel. For example, if I type "in_array" I will be given the autocomplete. I press enter, but do not get the variables. If I backspace part of the function name, I then get two autocomplete suggestions, the second being the one I actually want.

Maybe it could be set so autocomplete is never overriden from other already set autocomplete items? Sorry I don't have time to delve into the code to look at making a pull request right now.

Thanks in advance for your work on this plugin =]

alienhard commented 11 years ago

Does it make sense to use CodeIntel and this package at the same time? I've created this because CodeIntel doesn't work for me...

If it is a general problem, I'd appreciate if you could provide more information to help me reproduce the issue.

Relequestual commented 11 years ago

Indeed it does for me. I want the base autocomplete that CodeIntel gives, but I also want autocomplete for function names found in other files. For example calling model functions from the controller.

Maybe one solution could be to have a setting which would only pick up function declarations. If it makes a difference, I'm using PHP.

To replicate, install both plugins. Have one file which contains a var_dump in php. In the other file, type var_d and you'll see var_dump. The autocomplete will not include the variable. Continue to type var_dum, then backspace and the autocomplete will then show two options for var_dump, the second of which will include the variable.

alienhard commented 11 years ago

Unfortunately, I don't think that's possible as Sublime's API is very limited. We can just get a list of completions for a window, but no additional information about the kind of completion is provided (e.g., function declaration). Also, we don't know what completions other packages like CodeIntel add to the list. Obviously, we could parse the contents of the files to get to that information, but that's out of scope of this package...