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.
I encountered this problem when I was trying to provide code completion for the Hibernate Configuration XML files. I try to provide code completion for element values, such as, <property name="hibernate.show_sql">true</property> if I have the cursor right after ">", the code completion pops up properly. But if I have the cursor, for example, after the letter "t", then the code completion does not pop up. Basically, the code completion for the element value will pop up ONLY if the cursor is RIGHT AFTER ">". I have debugged into the code and found it is caused by the following code in XMLCompletionProvider.java (line 118) in the XML Text Editor module protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) { boolean noResults = doQuery(resultSet, doc, caretOffset); if(doc != null && noResults) { checkHideCompletion((BaseDocument)doc, caretOffset); } resultSet.finish(); } When the cursor is not right after ">", the closing tag is not in the resultSet. So, the noResults is true and the checkHideCompletion() gets invoked, which hides the code completion. Now here is my question: can this code be commented out? Otherwise, the code completion from other CompletionProvider can not work properly for element values
I have another question: is there a reason that the closing tag suggestion has to be right after the open tag ">"?
Dusan has done the following fix in editor.completion. Now, the xml editor does not need to do the specific hiding anymore. " FYI, code completion should behave now in the way as Mila suggested - in case of automatic invocation, if there are no suggestions, the popup would stay hidden. See changeset 6740db8e6988 in main details: http://hg.netbeans.org/main?cmd=changeset;node=6740db8e6988 Dusan "
Can you tell me how I can see this issue? Do I have to install hibernate or spring modules?
You don't have to install the Hibernate modules (BTW, Spring does not this issue because it is schema-based). You can see it in sun-web.xml file too in a little different way. Here is what you do: - create a web project - edit the sun-web.xml. After you finish the open tag with ">", you'll see the closing tag suggestion if the cursor is right after ">". Now, don't close the tag. Instead, give a space after ">"; then hit Ctrl+space, the closing tag suggestion will not popup. That's because the code in the XMLCompletionProvider is hiding the code completion.
But if you want to see it in Hibernate module, you can use the sample project I attached to issue http://www.netbeans.org/issues/show_bug.cgi?id=128063 and following the steps to get the Hibernate support modules. After you have the attached sample project open in NetBeans, look at the very first description of this bug. You should see the problem.
I have no idea why the checkHideCompletion() is there. This code gets executed for xml based on DTDs and hope will not break anything else. Fix integrated, http://hg.netbeans.org/main?cmd=changeset;node=912d865745c7.
Verified Product Version: NetBeans IDE Dev (Build 200808010201) 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)