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.
NB 5.0 build 200510111800 'Cannot suggets' message is shown when CC is invoked within closting tag. Steps to reproduce: 1) create this xml file: <?xml version="1.0" encoding="UTF-8"?> <root> <item> </i| </root> The '|' symbol shows the position of the cursor. 2) press ctrl-space ->'Cannot suggets' Invoking CC just after typing '</' works ok.
*** Issue 58184 has been marked as a duplicate of this issue. ***
This behaviour is unfortunately "as designed" from the beginning. There is not close tag support in XML CC. The only thing which works is the end tag autocompletion if you type </ and invoke CC. I will try to fix it.
Having this would be really good.
fixed Checking in XMLCompletionQuery.java; /cvs/xml/text-edit/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java,v <-- XMLCompletionQuery.java new revision: 1.40; previous revision: 1.39 done
CC of closing tags as described above does not work in current build (051312).
TM 5.0->TBD
Another usecase when the CC doesn't work correctly is when you have a DTD based XML file, type an open tag inside and after the tag type </ and invoke CC. The CC list contains the close tag until you start to type its name. Once you do that the CC list contains just a list of possible open tags!!!
*** Issue 74575 has been marked as a duplicate of this issue. ***
fixed the problem reported by Jirka - end tags are not offered when user types not just the end tag prefix e.g. </r. This works well now. However the problem discovered by me is still preset. The problem is with a bad HintContext initialization. Checking in XMLCompletionQuery.java; /cvs/xml/text-edit/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java,v <-- XMLCompletionQuery.java new revision: 1.37.54.1.2.6; previous revision: 1.37.54.1.2.5 done
The fix of the remaining issue would require either to hack the XMLCompletionQuery or properly fix the SyntaxQueryHelper not to cut the leading slash from pretext. The problem is that it is impossible to determine whether the current element is an endtag just from the data provided by HintContext. Since the "</" part is removed from the pretext neither the pretext can be used to determine the element type nor the HintContext node itself (node type is common for both start and end tags). The clean fix would IMHO be to not to cut the leading slash from the pretext. Since the SyntaxQueryHelper generates the HintContext which is used by various GrammarQuery implementations, it would be quite dangerous to change the behaviour now. So I will choose the bad solution for now (hack the XMLCQ) and add appropriate commet to it :-|
fixed the last minor problem. Checking in XMLCompletionQuery.java; /cvs/xml/text-edit/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java,v <-- XMLCompletionQuery.java new revision: 1.37.54.1.2.7; previous revision: 1.37.54.1.2.6 done
Verified NetBeans 5.5 RC1
It doesn't work again in 6.7
WFM in 7.1 dev