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 252259 - GoTo Symbol expects only java IDs in pattern name
Summary: GoTo Symbol expects only java IDs in pattern name
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Jump To (show other bugs)
Version: 8.1
Hardware: PC Solaris
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on: 253193 253263
Blocks:
  Show dependency tree
 
Reported: 2015-05-06 07:21 UTC by Alexander Simon
Modified: 2015-06-30 14:56 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch (1.79 KB, patch)
2015-06-30 14:56 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2015-05-06 07:21:45 UTC
C/C++ operator name can include characters: space, []+-()&*=<>|:!~^/%
For example valid operators names:
operator *
operator &
operator <
operator >

As result GoTo Symbol has several bugs:
1. Wrong display name of operator "operator &" in search results.
In table operators shows as "operator &amp;...."
2. Impossible to select "operator *"
3. There is no bold selection for operators: "operator =", "operator >", "operator <" , "operator ->" and other that include ">", "<" or "=".
Comment 1 Tomas Zezula 2015-05-07 09:07:21 UTC
Operator is not a symbol.

The []() are filtered in Vladimir's NameMatcherFactory (http://hg.netbeans.org/releases/file/b6fa2a485438/jumpto/src/org/netbeans/spi/jumpto/support/NameMatcherFactory.java)

The space is definitely not a valid input in Go To Symbol but it can be a valid symbol name if your SymbolDescriptor implements getSimpleName method.

The others seems problem with HtmlRenderer
Comment 2 Tomas Zezula 2015-05-20 14:19:30 UTC
Hi Alexander!
In which module is the c/c++ SymbolProvider implementation?
I will need to change it to resolve this issue.
Thanks
Comment 3 Alexander Simon 2015-05-20 14:24:12 UTC
(In reply to Tomas Zezula from comment #2)
> Hi Alexander!
> In which module is the c/c++ SymbolProvider implementation?
> I will need to change it to resolve this issue.
> Thanks
Hi Tomas,
It is:

cnd-main/cnd.gotodeclaration/src/org/netbeans/modules/cnd/gotodeclaration/symbol/CppSymbolProvider.java

Alexander
Comment 4 Tomas Zezula 2015-06-30 14:46:38 UTC
I've fixed the following parts of the issue:
1) Wrong display name of the operators
2) Match highlighting does not work for operators.

The last problem is with operator * but it cannot be fixed in generic infrastructure as * is treated as regexp and only CND knows that "operator *" has different meaning.

The CppSymbolProvider gets:

request {
text: "operator *",
searchType: "CASE_INSENSITIVE_REGEXP"
}

so it can special case this input and change the request into:

request {
text: "operator *",
searchType: "CASE_INSENSITIVE_PREFIX"
}

and it should fix the problem.

The jumpto parts fixed.
Comment 5 Tomas Zezula 2015-06-30 14:56:10 UTC
Created attachment 154447 [details]
Proposed patch

Patch special casing operator *