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 38342 - GrammarQuery.queryValues fails to document difference between attr & text completion semantics
Summary: GrammarQuery.queryValues fails to document difference between attr & text com...
Status: RESOLVED WONTFIX
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@xml
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2003-12-29 00:48 UTC by Jesse Glick
Modified: 2009-12-21 04:39 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 Jesse Glick 2003-12-29 00:48:09 UTC
It seems that GQ.qV called with an Attr expects
that the returned completions include the prefix;
e.g. in

  <foo bar="${pr

The returned completions should be e.g.

  ${property1}
  ${property2}

By contrast, GQ.qV called with a Text node seems
to expect that the prefix *won't* be included; e.g. in

  <foo>${pr

the returned completions should be e.g.

  operty1}
  operty2}

If you tried to return the same completions as for
an Attr, accepting the code completion would give
a mistaken result such as

  <foo>${pr${property1}

This behavior is pretty sensible, since the value
of an attribute is typically short and you would
usually want to see the whole proposed value in
the completion window; whereas the text content of
an element might be quite long and you only want
to see what will be added.

(Ideally there would be some way for the
GrammarResult to specify how much of the
replacement it wishes to display in the dialog, so
that for Ant you could show the full property name
but not surrounding text. But that is not
necessary, would just be nice.)

Found this out by trial and error in the
ant/grammar module. The behavior is OK, but if it
is intentional, it needs to be documented.

(BTW apparently only the Node/Text methods in
GrammarResult have any effect on code completion;
I couldn't see getDisplayName or getDescription
doing anything. Are they supposed to be used in
text code completion? Or only in xml/tree-edit?)
Comment 1 Quality Engineering 2009-12-21 04:39:54 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team