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 66607 - Show close tag items in CC + put them before open tags
Summary: Show close tag items in CC + put them before open tags
Status: RESOLVED WORKSFORME
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 58184 74575 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-12 13:36 UTC by Jiri Prox
Modified: 2011-10-26 08:05 UTC (History)
1 user (show)

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 Prox 2005-10-12 13:36:24 UTC
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.
Comment 1 Marek Fukala 2005-10-13 11:04:54 UTC
*** Issue 58184 has been marked as a duplicate of this issue. ***
Comment 2 Marek Fukala 2005-10-13 11:06:55 UTC
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.
Comment 3 Jiri Kovalsky 2005-10-17 08:15:01 UTC
Having this would be really good.
Comment 4 Marek Fukala 2005-11-23 11:38:46 UTC
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
Comment 5 Jiri Prox 2005-12-13 16:47:08 UTC
CC of closing tags as described above does not work in current build (051312).
Comment 6 Jaroslav Pospisil 2006-03-13 13:35:24 UTC
TM 5.0->TBD
Comment 7 Marek Fukala 2006-07-25 15:15:54 UTC
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!!!
Comment 8 Marek Fukala 2006-08-21 15:53:58 UTC
*** Issue 74575 has been marked as a duplicate of this issue. ***
Comment 9 Marek Fukala 2006-09-01 15:08:20 UTC
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
Comment 10 Marek Fukala 2006-09-01 15:43:24 UTC
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 :-|
Comment 11 Marek Fukala 2006-09-01 16:01:26 UTC
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
Comment 12 Jindrich Sedek 2006-10-09 17:08:01 UTC
Verified NetBeans 5.5 RC1
Comment 13 Nikita Krjukov 2009-05-21 16:44:13 UTC
It doesn't work again in 6.7
Comment 14 Svata Dedic 2011-10-26 08:05:02 UTC
WFM in 7.1 dev