Drupal autocompletions clobbering other autocompletions (eg. PHP) #6

Closed
ar1403 opened this Issue Sep 6, 2012 · 5 comments

Projects

None yet

4 participants

@ar1403
ar1403 commented Sep 6, 2012

Great plugin, very useful, many thanks :)

Unfortunately it seems that when the plugin is enabled, native PHP library autocompletions no longer work. Typing in_array at no point reveals the in_array() autocompletion for example, so I'm forced to disable the plugin when I want PHP autocompletions, and then re-enable it for a Drupal auto-completion.

It would be great if both native PHP and Drupal autocompletions were available simultaneously!

Thanks again, great work.

@manubing

I'm affected too... API-injected completion are not displayed.

According to the doc: http://docs.sublimetext.info/en/latest/extensibility/completions.html :

Completions not only originate in .sublime-completions files. This is the exhaustive list of sources for completions:

    Snippets
    API-injected completions
    .sublime-completions files
    Words in buffer

Can we help by providing some logs?

@slashrsm

I can confirm the same problem....

@slashrsm

I managed to fix this: #8

The case is that this plugin uses API to inject which overrides matches from files. In my fix I added some code, that returns only those Durpal tags that match current prefix inserted by user. If no match is found Sublime now proceeds downwards on priority list and shows suggestions from PHP completion file.

I also added configuration option that allows user to choose between "contains" and "starts with" matching.

P.S.: This behaviour is a bit strange..... If I entered "array" I got suggestions from snippets (higher priority than API entries), from API entries but not from .sublime-completions. This is strange, since I'd expect snippets to override API entries the same way as API entries override tags from files. Will try to investigate this a bit more...

@tanc tanc was assigned Mar 17, 2013
@tanc
Owner
tanc commented Mar 17, 2013

Thanks to slashrsm this should now be fixed. I've decided to just use the 'starts with' matching style as this is actually matching within function names rather than just at the beginning. For example typing 'string' matches is_string, recode_string etc. The 'contains' method was returning anything at all that had the characters anywhere in it and I think that method isn't as useful to people and seemed a bit buggy as you mentioned.

@slashrsm

Great! Nice plugin. Thank you for your contribution!

@tanc tanc closed this Sep 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment