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 140511 - Code completion doesn't work
Summary: Code completion doesn't work
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
: 112500 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-17 13:34 UTC by Jaromir Uhrik
Modified: 2008-08-05 18:58 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
large xml document where no problem seen (295.82 KB, text/plain)
2008-07-18 17:43 UTC, tonybeckham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromir Uhrik 2008-07-17 13:34:16 UTC
Product Version: NetBeans IDE Dev (Build 200807170007)
Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

Code completion is not invoked in .xml when pushing Ctrl+Space. The common way for invoking code completion in NetBeans
IDE is pushing Ctrl+Space which is not working but when the user writes the start of tag and then waits the code
completion appears (which works only for tag but not attributes; attributes completion must be called by Ctrl+Space
which parradoxly works).
Comment 1 Samaresh Panda 2008-07-17 17:53:59 UTC
Depends on where you're pressing Ctrl+Space. Will you be able to attach a xml and tell me excatly where it doesn't work?
Comment 2 Samaresh Panda 2008-07-17 18:28:58 UTC
Tony, can you please try and update?
Comment 3 tonybeckham 2008-07-17 19:04:49 UTC
Appears to be working for me.

Product Version: NetBeans IDE Dev (Build 200807170007)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)
Comment 4 Samaresh Panda 2008-07-17 19:53:35 UTC
It seems to be working fine.
Comment 5 tonybeckham 2008-07-17 19:55:20 UTC
Verified

Product Version: NetBeans IDE Dev (Build 200807170007)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)
Comment 6 Jaromir Uhrik 2008-07-18 10:02:02 UTC
I see, the problem is I am pushing quickly the following sequence: '<' then Ctrl+SpaceBar
When the '<' is pushed the code completion appears pretty quickly but then I press Ctrl+SpaceBar which causes that "No
Suggestions" appear and code completion disappears. So that the bug is that "No Suggestions" appears after pushing '<'
followed by Ctrl+SpaceBar. 
I am reopening issue and lowering the priority to P3.
Comment 7 tonybeckham 2008-07-18 17:42:28 UTC
I am unable to reproduce even using a really large xml document.  Can you reproduce using any xml document?  Can you
attach one that you are able to see this issue using?
Comment 8 tonybeckham 2008-07-18 17:43:22 UTC
Created attachment 64980 [details]
large xml document where no problem seen
Comment 9 Tomas Danek 2008-07-21 17:19:11 UTC
Please try with those steps:

Product Version: NetBeans IDE Dev (Build 200807181543)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb)
Userdir: /tmp/ud

Steps to reproduce:
-----------------
- create new java project
- open it's build.xml
- try to add new target by following:
- type '<' -> CC appear, that is fine. However many users type something like '<tar' and push CTRL-space immediately.
That gets the "no suggestion" box. Problem is not that CC does not work, problem is that CC is interrupted by
CTRL-SPACE. Size of XML does not matter IMHO. P2 since that during e.g. developing Ant scripts with help of CC you have
to rapidly change the behavior (compared with developing Java), because CTRL-SPACE does not bring up completion, but
kills already popped up one. 
Comment 10 tonybeckham 2008-07-21 20:06:14 UTC
System Information:
Product Version: NetBeans IDE Dev (Build 200807181543)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)

I see the problem.  Once editing a tag and CC suggestion is dismissed (in whatever manner) and the tag is still
incomplete, then invoking CC offers no suggestions.  I was able to reproduce this behavior with the steps in desc 10.  I
still cannot reproduce with a schema or schema constrained XML document.
Comment 11 Samaresh Panda 2008-07-21 23:10:26 UTC
editor/completion gurus, kindly take a look at this. I have no idea why this is a problem in XML based on DTD. The "No
suggestions" seems to be coming from the else block of if(completionResultSets.size() > 0) in
CompletionImpl::completionQuery().
Comment 12 Jan Becicka 2008-07-22 12:33:57 UTC
Of course, that "No suggestions" appears if completionResultSets.size() == 0.
This is as designed. The bug is in xml editor. Adding Dusan on cc.
Comment 13 Samaresh Panda 2008-07-22 18:35:35 UTC
I thought that was clear. I was hoping you guys will be able to throw some light. What's not clear is why the pop-up
disappears only in this use-case. For java CC or xml based on schemas, this works nicely.
Comment 14 Jan Becicka 2008-07-23 08:24:40 UTC
I've just reassigned this issue to proper component.
Comment 15 Dusan Balek 2008-07-23 09:03:00 UTC
Samaresh, try to put a breakpoint to the CompletionImpl.hideCompletion(boolean) method, just to make sure that nobody is
calling Completion.hideCompletion() or Completion.hideAll() methods.
Comment 16 Samaresh Panda 2008-07-24 23:09:04 UTC
Sorry, it doesn't hide but somehow bring up "No Suggestions". Try as per instructions by musilt2 on Mon Jul 21 2008.
That will help you understand the issue.
Comment 17 Samaresh Panda 2008-08-04 22:57:14 UTC
Fix integrated: http://hg.netbeans.org/main/rev/6d4fad410f77.
Comment 18 Samaresh Panda 2008-08-04 23:03:53 UTC
*** Issue 112500 has been marked as a duplicate of this issue. ***
Comment 19 Quality Engineering 2008-08-05 16:35:07 UTC
Integrated into 'main-golden', available in build *200808051401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/6d4fad410f77
User: samaresh@netbeans.org
Log: #140511 Code completion doesn't work
Comment 20 tonybeckham 2008-08-05 18:58:33 UTC
Fix verified

Product Version: NetBeans IDE 6.5 Beta (Build 200808051501)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.4 running on i386; MacRoman; en_US (nb)