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 244122 - Go to file doesn't work as expected for "_" prefixes.
Summary: Go to file doesn't work as expected for "_" prefixes.
Alias: None
Product: utilities
Classification: Unclassified
Component: Jump To (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Zezula
Depends on:
Reported: 2014-04-28 09:30 UTC by Christian Lenz
Modified: 2015-07-14 15:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Go to file problem (15.71 KB, image/png)
2014-04-28 09:30 UTC, Christian Lenz
angc. (16.03 KB, image/png)
2014-06-27 13:43 UTC, Christian Lenz
Go to file BaMa (36.60 KB, image/png)
2014-07-31 12:52 UTC, Christian Lenz
Extended camel case - fixing problem 1 (12.73 KB, patch)
2014-08-04 14:07 UTC, Tomas Zezula
Details | Diff
Fuzzy search (15.67 KB, patch)
2014-08-04 14:08 UTC, Tomas Zezula
Details | Diff
New go to file problem. (507.76 KB, image/gif)
2015-07-13 15:05 UTC, Christian Lenz

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2014-04-28 09:30:04 UTC
Created attachment 146979 [details]
Go to file problem

As you can see in the screenshot (Go to file problem), I have a file called _settingsWindow.scss. I search for _setWi and I got result, same happens when I search for settW.


Comment 1 Jiri Prox 2014-04-28 09:47:10 UTC
Comment 2 Christian Lenz 2014-04-28 10:22:25 UTC
I got no results I mean ^^.
Comment 3 Christian Lenz 2014-06-25 11:07:00 UTC
The same for this example:

File: ApiBasketManager.js

Go To File: BasMan (No result)
Go To File: ABaMan (Result)

What I figured out is that the regex doesn't work for the documents dialog. Shift + F4 opens documents dialog. I have a lot of files and two of those looks like:


and when I type OrCl it's not jumping to the file.


Comment 4 Christian Lenz 2014-06-27 13:43:31 UTC
If I have a file called angular-cookies.js and I want to search for "angc." it doesn't work too. If you can see it in my screenshot (angc.), this searchterm works in intelliJ.
Comment 5 Christian Lenz 2014-06-27 13:43:57 UTC
Created attachment 147802 [details]
Comment 6 Christian Lenz 2014-07-30 07:13:37 UTC
I figured out, that the plugin Open File Fast: has the mode smart and normal. Smart is exactly what Go To File needs. they find _alerts.scssc via search for asc or or acs. Missing feature for Open file fast is an option to say case sensitive ^^.
Comment 7 Tomas Zezula 2014-07-31 11:50:24 UTC
The '_' should be supported character.
Comment 8 Christian Lenz 2014-07-31 12:21:37 UTC
Should I create new tickets for the other behaviours, which I mentioned before?
Comment 9 Tomas Zezula 2014-07-31 12:34:43 UTC
Here is recapitulation:
1) '_' does not work - covered by this issue

2) angular-cookies.js does not work when searching 'angc' - covered by this issue

3) Shift + F4 -> please create a new issue on it on platform/windows system it has nothing in common with Go To File, thanks

4) ApiBasketManager.js - wontfix as BasMan is not a camel case of ApiBasketManager.
The BasMan matches ApiBasketManager.js only for .*Bas.*Man.* which is greedy regexp and there is no a way how to match such a pattern except of sequential search.

Did I forgot something?
Comment 10 Christian Lenz 2014-07-31 12:52:07 UTC
1. Check.
2. Check, but its not only "angc" its "angc." too, don't forget the dot ;).
3. Check, I will do it.
4. Hm I understand it, but what i figured out is that intelliJ will find those files if you search for BaMa but they will be shown in a separate area. See my screenshot for this. So I can live without the option to see those files in a separate list, but it's only a hint :).

Thx for your feedback and for your work.


Comment 11 Christian Lenz 2014-07-31 12:52:37 UTC
Created attachment 148443 [details]
Go to file BaMa
Comment 12 Christian Lenz 2014-07-31 12:53:53 UTC
Ah and I forgot to say, that it should work for Go To File/Type/Symbol and what we have yet.
Comment 13 Tomas Zezula 2014-08-01 12:14:44 UTC
Hi Chris,
one more question :-)
I've fixed the point 1 but I needed to change meaning of the camel case. Currently the camel case is defined as (UpperCaseLetter.*){2,}. 'TeFi' is a camel case of TestFile but teFi is not. As I changed the behaviour I need to do apichange request.
My question is can you look at issue #146998 to me it seems as a super set of required behaviour. If you agree I would keep the current behaviour of camel case as it is but introduce a new "fuzzy" type as described in the issue.
Comment 14 Christian Lenz 2014-08-01 12:40:33 UTC
For me, I don't want to find TestFile when I type teF, when I have enabled came case navigation, then I will find a file called testFile.js for example.

Here are some examples:

ABaM | BaM -> ApiBasketManager.js (Yes we have discussed the second part, only an example and it should not be selected, but in a separate list, as in IDEA)
angc. | ang | a-c | a-o -> angular-cookie.js

teF -> testFile.js | _testFile.scss (Not selected but in a separate list, as in IDEA)

TeF -> TestFile

When I disabled camel case search and search for teF, then I would see TestFile, temp-folder and so on.
Comment 15 Christian Lenz 2014-08-01 12:41:09 UTC
Case sensitive I mean, not camel case navigation. Sry.
Comment 16 Tomas Zezula 2014-08-01 12:57:03 UTC
Thanks a lot.
From the examples it's in fact the #146998 fuzzy search.
Either case sensitive TeF -> TestFile but not to testFile.js or case insensitive
tef matching both TestFile and testFile.js
Comment 17 Christian Lenz 2014-08-01 13:05:48 UTC
Correct but tef should only find TestFile, testfile, Testfile, testFile when the option case sensitive is deactivated. For my opinion.
Comment 18 Tomas Zezula 2014-08-04 14:06:29 UTC
I've implemented the algorithm proposed in the issue #146998, but it's too forgiving and returns much more matches.
I've downloaded Idea 13 and tried the same query and the fuzzy algorithm from issue #146998 was quite useless as it was hard to find the intuitive hits.
As I tested the Idea it seems that it rather does some relaxed camel case where the split points are not just capital letters but also special characters like '-','_'.
It's probably the best behaviour.

I will attach the possible implementations not to lose them
1) Extended CAMEL CASE fixing the problem 1
2) The fuzzy search - described in this comment
Comment 19 Tomas Zezula 2014-08-04 14:07:39 UTC
Created attachment 148526 [details]
Extended camel case - fixing problem 1
Comment 20 Tomas Zezula 2014-08-04 14:08:08 UTC
Created attachment 148527 [details]
Fuzzy search
Comment 21 Christian Lenz 2014-08-04 14:30:56 UTC
I would love to test your changes soon :).

Thx a lot.
Comment 22 Vladimir Voskresensky 2014-08-20 11:31:59 UTC
I vote for the patch which allows to find functions started with lower case i.e. "getArgumentNum" by typing "getArNu".
Is it fuzzy search?
Comment 23 Tomas Zezula 2014-08-20 11:38:54 UTC
It's the extended camel case.
Fuzzy search comes from request from issue 146998, the fuzzy query rewrites to something like:
jaso -> /j[^a]*a[^s]*s[^o]*o*/i
but it's very broad especially for Go To Type where it offers lots of JDK classes for short strings.
The extended camel case seems better but I want to extend it event more to define possibly pluggable split points not just upper case characters.
I've tested it in Idea and it seems that it does camel case where the split points are not just capital letters but also special characters like '-','_'.
It's probably the best behaviour.
Comment 24 Vladimir Voskresensky 2014-08-25 09:00:39 UTC
Tomas, looking for your commit. I'm fine to have it under flag, so can test it daily.
Comment 25 Christian Lenz 2014-10-16 12:26:56 UTC
It's not implemented yet, isn't it?
Comment 26 Christian Lenz 2015-01-04 17:00:29 UTC
Anything new here?
Comment 27 Tomas Zezula 2015-01-12 09:50:27 UTC
Scheduled for NB 8.1
Comment 28 Tomas Zezula 2015-04-15 11:15:41 UTC
Hi Chris!

I've put there the extended Camel Case allowing you the "_" prefixes or case insensitive reg exp.
Also the a-c -> angular-cookie.js should work.

The a-o and BasMan are not supported as they are no valid CamelCase. They are fuzzy (lazier) matching. The problem with it is that they produce lots of positive matches for short patterns in Go To Type and Go To Symbol.

I will enable it only in Go To File by command line option no by default to let you test it as part of issue #146998. I've added you on the CC List of this issue.
Comment 29 Tomas Zezula 2015-04-15 11:21:04 UTC
I've forgot the commit:
Comment 30 Quality Engineering 2015-04-16 06:35:58 UTC
Integrated into 'main-silver', will be available in build *201504160452* on (upload may still be in progress)

User: Tomas Zezula <>
Log: #244122:Go to file doesn't work as expected for "_" prefixes.
Comment 31 Christian Lenz 2015-07-13 15:04:33 UTC
Hard to explain ^^. I added a new attachment (New go to file problem). As you can see when I type "autosave" everything is fine (independent from checking case sensitive or not). When I remove the character "u" I got no result. After this I tried aTOVE or aToVe and I got result back again. When I check case sensitive the result appears what is correct. Than the problem with the _ in front of a file still happens. I have a file _headerContent.html and when I type "headc" nothing happens, I got an other filewith name headContent.html what is fine and correct too, but _headerContent.html is missing in the list. When I type "_headC" I got the correct file. When I type "_headc" I got nothing. Tested it with the latest nightly 201507130001.
Comment 32 Christian Lenz 2015-07-13 15:05:22 UTC
Created attachment 154596 [details]
New go to file problem.
Comment 33 Tomas Zezula 2015-07-13 15:09:16 UTC
Chris please create a new report as this is unrelated bug.
You don't need to upload the video into it just put the link there.
Comment 34 Christian Lenz 2015-07-13 15:44:43 UTC
Thx, I will, but what I think is that the _ prefix problem still happens but I will file a new one.
Comment 35 Christian Lenz 2015-07-13 21:47:20 UTC
Here is the new one:
Comment 36 Tomas Zezula 2015-07-14 15:56:33 UTC