Home Download Buy Blog Forum Support

Are API-injected completions working in ST3?

Are API-injected completions working in ST3?

Postby phyllisstein on Sun Mar 31, 2013 10:39 am

Hi all,
I was wondering whether anyone had tried writing API-injected completions under ST3, and whether they'd had any luck. I ask because HTML completions don't seem to work in build 3022: in ST2, typing "<" gives me a fuzzy-matched list of tags, and in ST3, it doesn't do anything; and since I know they're handled by an on_query_completions call, I thought I'd check before I went nuts trying to do it myself. For what it's worth, I tried removing all my packages and testing it again—still nothing, so it's not being interfered with by anything I've already done or installed.

Thanks in advance for the help!
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am

Re: Are API-injected completions working in ST3?

Postby skuroda on Sun Mar 31, 2013 8:12 pm

It looks like the html_completions.py has been modified (from ST2). If you type "<c" then manually bring up the auto completion list, they appear properly.

Also, there is the following

Code: Select all
if prefix == '':
            # need completion list to match
            return ([], sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)


When you enter "<", the prefix is still empty, which explains why nothing is shown.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am

Re: Are API-injected completions working in ST3?

Postby jps on Wed Apr 03, 2013 4:42 am

HTML completions are only displayed after the first character is entered. This allows the completion list to display either only uppercase or only lowercase tags depending on what you enter.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Are API-injected completions working in ST3?

Postby skuroda on Wed Apr 03, 2013 5:32 am

jps wrote:HTML completions are only displayed after the first character is entered. This allows the completion list to display either only uppercase or only lowercase tags depending on what you enter.


But after you enter the first character, aren't you back in the text.html scope, so the autocomplete pop up doesn't trigger? I did a quick test and I can manually bring up the auto complete options, and everything is populated fine, so I know it's there. Well, that's the behavior I see on Windows 7 x64. I haven't tried it in anything else.

Edit:
Forgot to mention this. I also added "text.html" as an "auto_complete_selector". By doing this, the pop up appears as expected. This was more of a sanity check than anything else.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am

Re: Are API-injected completions working in ST3?

Postby phyllisstein on Wed Apr 03, 2013 2:48 pm

Alright, thanks; glad to know that it's just a triggering change rather than an API change. Seemed worthwhile to check before I did anything myself to break it!
phyllisstein
 
Posts: 49
Joined: Fri Aug 24, 2012 5:28 am


Return to Plugin Development

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 4 guests