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.
Consider this XML document: ---%<--- <!DOCTYPE x [ <!ELEMENT x (a*, b*)> <!ELEMENT a EMPTY> <!ELEMENT b EMPTY> ]> <x> <a/> <b/> <!-- here --> </x> ---%<--- Open such a file in NB. Put the cursor at the comment (I tried in dev jan 13) and type '<' then Ctrl-Space. You are offered both <a> and <b> as completions; yet only <b> is actually valid. FWIW, Emacs' PSGML mode gets it right: before <b/> you are offered either, but after you are only offered another <b>. For some DTDs with a lot of elements in a single parent, all in a particular order (apichanges.xml comes to mind) it is very important for usability of code completion that it only offer elements valid at the current point.
I have heavy problems with equality and lifetime of on-fly created DOM Nodes. Anyway I also have working prototype.
Integrated: <-- ContentModel.java new revision: 1.2 <-- DTDGrammar.java new revision: 1.10 <-- DTDParser.java new revision: 1.4 <-- SyntaxElement.java new revision: 1.6 <-- SyntaxNode.java new revision: 1.4 <-- Tag.java new revision: 1.10
*** Issue 19775 has been marked as a duplicate of this issue. ***
Rolling back. I must improve the ContentModel class reliability.
Reintegrated. Added netbeans.xml.completion system property that can take following values: fast, default or accurate. Fast maps to original behaviour, default to behaviour with this fix/enhancement and accurate is reserved for #20762 implementation.
Default content model doesn't offer all appropriate elements. e.g. in the xhtml <table> element doesn't offer: <tr>, ...
Sucesfully tested with XHTML tables. 6 new tests added. Comparing to infinite input/output possibilities...
I tried on Build 200303132350 with Jesse's sample and completion doesn't work at all.
Yes, I've been having serious problems with completion lately too (dev mar 11 I think) but forgot to file it. Working on a <MIME-resolver>, I think I had a <file> with three <ext>s in it followed by a <resolver>, and when positioning the cursor after the first <ext>, I could not get any element completion. Or something like that.
Silent code completion is another issue #32042.
I'm using NB 3.5-RC1. The implementation which was intended to solve this issue seems to be very buggy and causes the XML code completion to be usless in many cases. Try for example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE root [ <!ELEMENT root (sub1,sub2?,sub3?,sub4?)> <!ELEMENT sub1 (#PCDATA)> <!ELEMENT sub2 (#PCDATA)> <!ELEMENT sub3 (#PCDATA)> <!ELEMENT sub4 (#PCDATA)> ]> <root> <sub1>test</sub1> <sub3>test3</sub3> <!-- press ctrl-space here --> </root> sub3 and sub4 should be allowed here but nothing is allowed. I use the XML editor a lot to write docbook documents, but I can't use v3.5 because of this bug. I thus prefer that this fix will be rollbacked until later versions, if it isn't too late for v3.5 final.
I'm affraid that for NB 3.5 it's too late. Meanwhile there is a system property: runide -J-Dnetbeans.xml.completion=fast fast is another name for the old implementation (that offers more possibilities).
*** Issue 34453 has been marked as a duplicate of this issue. ***
34453 excerpt: This may be more XML-module related thing. When either creating or mounting web module filesystem then there is code-completion support in its deployment descriptor (web.xml). However this works only at begining of that file: <!-- xml declaration and dtd prolog is here --> <web-app> <!-- here is the place where code-completion works --> <session-config> <session-timeout> 30 </session-timeout> </session-config> <!-- here it does not work --> </web-app>
Created attachment 10774 [details] Another sample.
Created attachment 10781 [details] Project branch patch
Fixed in prj40_prototype branch. This patch is worth to deliver to users ASAP, it affects all XML documents following many common DTDs. It's safe to backport to release35 (and release the patch via NB-AU). It's covered by unit tests.
Created attachment 10785 [details] release35 patch (prepared for beta AU deployment)
This looks like a SIMPLEFIX to me, do you agree? Only a couple of lines of code changed.
Yes indeed. I just have not been aware of the SIMPLEFIX kw.
I have asked aumasters to deploy updated nbm to beta AU.
VERIFIED
Fixed also in Nevada Patch 1 and in Arrow.