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 54607 - Code completion offers cross-linking end tags.
Summary: Code completion offers cross-linking end tags.
Status: CLOSED INVALID
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-07 08:20 UTC by Jiri Kovalsky
Modified: 2009-05-18 10:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2005-02-07 08:20:03 UTC
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.
Comment 1 Marek Fukala 2005-02-10 18:28:10 UTC
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
Comment 2 Jiri Kovalsky 2005-02-10 20:42:16 UTC
Okay, I see your point now. After all, this was only a P4 issue. :-)
Verified as an invalid defect.