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.
Development build #200502061900 of NetBeans 4.1 Windows XP, JDK 1.5.0_02 build #05 Description: ============ Code completion in HTML suggests end tags that actually do not make sense. It should offer only tag that can be closed at particular place. Steps to reproduce: =================== 1. Create new sample web application project. 2. Create new HTML file underneath. 3. Write </ after <head> tag at line 4. 4. Code completion suggests to close <html> as one possibility.
In fact the behaviour is correct. DTDs for HTML documents define for each tag whether the tag has optional or required start and end tag. For example for HTML tag both start and end tags are optional meanwhile for TABLE tag are both required. The CC is driven by this metadata. When you write for example: <table> <tr> <td> </ and invoke CC - the CC will find all open tags before cursor and checks which ones has optional ends and which don't. Since the TD and TR has optional end the CC offers all items. In another example: <table> <tr> <td> <a> </ the A tag has required end so the CC offers only this one. The rules refers to the example you mentioned as well. I hope this is an acceptable explanation of the CC behaviour. Read more information in: http://www.w3.org/TR/REC-html40/struct/global.html http://www.w3.org/TR/REC-html40/sgml/dtd.html
Okay, I see your point now. After all, this was only a P4 issue. :-) Verified as an invalid defect.