Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 251037 - option so <TAB> does not exit/finish completion, only does common prefix
option so <TAB> does not exit/finish completion, only does common prefix
Status: VERIFIED FIXED
Product: editor
Classification: Unclassified
Component: Completion & Templates
8.0.2
PC Windows 7
: P2 (vote)
: 8.1
Assigned To: Dusan Balek
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-03-09 15:20 UTC by err
Modified: 2015-04-01 13:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments
possible (1.26 KB, patch)
2015-03-09 19:58 UTC, err
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-03-09 15:20:27 UTC
It's been a while since I've done a lot of work with NB.  I find I've been 
doing a lot more typing (doing undo and backspace) because of what tab does 
during completion.  The change for Bug 208223 messed things up for me.

The current setup requires a very conscious scan of the completion list in
order to determine what TAB will do; this extra work diminishes the usefulness 
of common prefix completion. I'd prefer to hit tab and know that my next
character input will refine my choices. Now I have to examine the list 
carefully, and then make my editing choice. In addition, since <ENTER> is 
easily available, there's little advantage to using <TAB>.

So if alternate behavior is wanted, an option seems appropriate so it doesn't 
mess with the smooth and interactive feedback feel of tab used only for prefix.
If the completion list only had one element, OK with tab finishing seems OK.

(BTW, I think the change for Bug 208223 is like dumbing down the editor so
that it behaves like IDEA. ;-) )

Example use cases:

Consider
    - enter
        Il<Ctrl-space>
    observe list of several exceptions
    - enter
        <tab>
    observe filling in common prefix

    - note: if <tab> entered again at this point completion finishes
      It could be argued that since the highlighted item shares a common
      prefix that prefix should be completed. Better to do nothing.

    - Consider this one, enter
        Illegal<ctrl-space>
    observe about 6 items,
    - enter
        a
    observe the list goes down to three items. In this case I want one of the
    illegalaccess choices so I
    - enter
        <tab>
    and it completes, even though the highlighted item has a long common
    prefix with the next item. I made a mistake. (I should have entered
    "ac<tab>".)  If after just "a<tab>" nothing had happened it's easy to
    continue; I just enter the "C<tab>", but it's not so easy if it completes.

If there is an issue about the UI, I'd be happy with a system property 
-DCompletionTabOnlyForPrefix or somesuch that I can set during startup
while the UX people sort things out.
Comment 1 err 2015-03-09 19:58:15 UTC
Created attachment 152511 [details]
possible

Attached a patch that shows proof of concept. It only executes the change from Bug 208223 when Boolean.getBoolean("editor.completion.TabOnlyForPrefix") is false. If the system property is true then you get the original behavior.

I made no attempt to understand the surrounding code; it seems to work.

It's a proof of concept. I suppose it could be used as is, but caching the value of Boolean.getBoolean("editor.completion.TabOnlyForPrefix") might be good.
Comment 2 Dusan Balek 2015-03-10 14:06:55 UTC
'org.netbeans.modules.editor.completion.noTabCompletion' option added.

http://hg.netbeans.org/jet-main/rev/7d4647535f38
Comment 3 Quality Engineering 2015-03-13 03:13:56 UTC
Integrated into 'main-silver', will be available in build *201503130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7d4647535f38
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #251037: option so <TAB> does not exit/finish completion, only does common prefix - fixed.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo