This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 179726 - code template fails to expand with code completion popup
Summary: code template fails to expand with code completion popup
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.3
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords: UI, USABILITY
Depends on:
Blocks:
 
Reported: 2010-01-20 21:13 UTC by dextml
Modified: 2013-03-28 10:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dextml 2010-01-20 21:13:54 UTC
If the "auto popup on typing any java identifier part" is turned on, there's a big  possibility that code template fails to expand. 

REASON:
It's because that the typing speed is not fast enough, so that the code completion window pops up during typing a code template nick.

IMPROVEMENT:
The code template expansion should do nothing with the code completion popup.
It should expand upon the end of typing.
Comment 1 Vitezslav Stejskal 2010-02-01 05:11:20 UTC
Making this a defect. IMO the problem is in CC, which (when displayed) handles the TAB key in a special way (tries to complete the common prefix of the offered CC items). However, in this particular case when a code template is offered as well the TAB key should simply mean selecting the template's CC item.
Comment 2 Dusan Balek 2010-11-10 08:27:48 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/fcc6f399e3f1
Comment 3 Quality Engineering 2010-11-11 06:12:10 UTC
Integrated into 'main-golden', will be available in build *201011110000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fcc6f399e3f1
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #179726: code template fails to expand with code completion popup - fixed.
Comment 4 b.akos 2013-03-26 18:05:42 UTC
Seems to be reappeared in 7.3.

Steps to reproduce (in Java project):
1. Type St
2. Popup appears (with StackOverflowError selected).
3. Press <TAB>: instead of completing the template (to String) StackOverflowError is inserted.
3b. If you instead cancel the CC with <ESC> and then press <TAB>, then String is completed.

Just checked: 7.1 surely behaved differently and completed to String even with CC popup on and StackOverflowError selected.

(Probably a regression by bug 208223 ?)
Comment 5 b.akos 2013-03-27 06:23:01 UTC
Another test (for keywords):

1. Type sw
2. Press <TAB>

Expected: expanded to
    switch (var) {
      case val:
        
        break;
      default:
        throw new AssertionError();
    }
    
Actual: expanded to switch (keyword from CC)

Interestingly it already had glitches in 7.1, and only worked after expanding first time without CC, but then worked also with CC popup on, until file was closed.

Now in 7.3 it is never working with CC popup on.

I think, code templates should have the highest priority and completion from CC (even for keywords) should only occur if there are no templates for the typed characters.
Comment 6 Jiri Prox 2013-03-28 10:40:37 UTC
I can reproduce it in 7.3, but it works fine in dev build