Home Download Buy Blog Forum Support

[BUG] Autocompletion doesn't open the popup

[BUG] Autocompletion doesn't open the popup

Postby bizoo on Fri May 13, 2011 10:01 am

Start a new file and enter:
Code: Select all
vDocNumber
vComNameDOC
vGcoNameDOC


The IMHO right behavior:
    type vn
    tab -> vDocNumber
    ctrl+space -> open the autocompletion popup

Now the wrong one:
    type vdoc
    tab -> vDocNumber
    ctrl+space -> vComNameDOC

There's no way to autocomplete with vGcoNameDOC

And same strange behavior without the tab key:
    type vdoc
    ctrl+space -> vComNameDOC

startup, version: 2060 windows x64 channel: dev
bizoo
 
Posts: 877
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: [BUG] Autocompletion doesn't open the popup

Postby jps on Fri May 13, 2011 11:31 am

Ctrl+Space will insert the best completion, rather than showing a list, if the first completion ranks significantly better than the next best completion. This is important, otherwise ctrl+space can end up showing a list of completions when there's only a single sane choice.

I don't believe it's clear that a list should be shown in this example for the completion 'vdoc'.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: [BUG] Autocompletion doesn't open the popup

Postby bizoo on Fri May 13, 2011 12:24 pm

Your explication make sense to me, but I don't think that the current behavior match exactly what you expect.

It look like, at least when tab_completion is active, ctrl+space always trigger the second best completion rank, whatever you press tab before or not.
I suppose that this behavior only make sense if the last command was an "insert_best_completion", so in this example the correct completion is "vDocNumber", isn't it ?
    type vdoc
    ctrl+space -> vComNameDOC

And the second glitch is that in my list, for "vdoc" the best completion is clearly "vDocNumber", but the two others must be almost at the same level.
So I think in this case the popup must be shown.
    type vdoc
    tab -> vDocNumber
    ctrl+space -> vComNameDOC
It look like ST make the decision to not show the popup based not on the remaining items in the list, but on the complete items list.
In this context ST must look at the remaining items (vComNameDOC, vGcoNameDOC) and because the rank is almost the same show the popup.

Hope I was clear.

Thanks for your time.
bizoo
 
Posts: 877
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: [BUG] Autocompletion doesn't open the popup

Postby jps on Fri May 13, 2011 12:36 pm

In a buffer containing only those three lines, typing vdoc on a new line and pressing ctrl+space will show a popup for me. Which entry in the list is highlighted depends on the selection history, e.g., change the highlighted entry, press enter, and repeat the experiment - the initial highlight will now be different.

vDocNumber ranks significantly higher than the others for vdoc (suppressing the popup), because vdoc is a prefix of vDocNumber, but not of the other entries. Prefix matches are ranked highly, in part because that's what users expect from non-fuzzy matching auto completion systems.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: [BUG] Autocompletion doesn't open the popup

Postby bizoo on Fri May 13, 2011 2:00 pm

jps wrote:In a buffer containing only those three lines, typing vdoc on a new line and pressing ctrl+space will show a popup for me. Which entry in the list is highlighted depends on the selection history, e.g., change the highlighted entry, press enter, and repeat the experiment - the initial highlight will now be different.

Ah this is the problem, for me in the same context typing vdoc and pressing ctrl+space replace "vdoc" by "vComNameDOC" without showing the popup, whatever the value of tab_completion.

Any idea of why this difference in the behavior between you and me ?
There's nothing special in my key bindings file.

Edit:
I try to delete these lines from "auto_complete" block of my Session.sublime_session:
Code: Select all
[
"vdoc",
"vComNameDOC"
],

and now the behavior is different:
Code: Select all
type vdoc
ctrl+space or tab -> vDocNumber
ctrl+space -> nothing happen

So it's better but no popup for me ???
bizoo
 
Posts: 877
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: [BUG] Autocompletion doesn't open the popup

Postby jps on Sat May 14, 2011 2:02 am

Sorry, I was getting confused with a testing build there - ctrl+space on "vdoc" completes it to "vDocNumber" for me, without showing a popup, because the completion for vDocNumber ranks much higher than the others, because of the prefix match.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: [BUG] Autocompletion doesn't open the popup

Postby bizoo on Mon May 16, 2011 10:38 am

jps wrote:Sorry, I was getting confused with a testing build there - ctrl+space on "vdoc" completes it to "vDocNumber" for me, without showing a popup, because the completion for vDocNumber ranks much higher than the others, because of the prefix match.

Thanks for your answer and sorry if I seem low-minded, but I still believe that the current behavior is not correct when you use ctrl+space to correct the last completion:
this is the current behavior:
    type vdoc
    tab (or ctrl+space) -> vDocName
    ctrl+space -> nothing

And this is what I expect:
    type vdoc
    tab (or ctrl+space) -> vDocName
    ctrl+space -> open the autocompletion list

If the default (higher) completion doesn't return the right thing, I like to choose another item even if the default one as a much greater rank than the others.
I think that the best thing to do when you correct an already completed word is to open the popup list.
You could try with "vname" in this example to show what I expect.
bizoo
 
Posts: 877
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland


Return to Technical Support

Who is online

Users browsing this forum: Elengar, Exabot [Bot], Google [Bot], Yahoo [Bot] and 22 guests