Confusing wildcard search

when using a wildcard when searching for e.g. a file (Ctrl+Shift+N), I seem to get a confusing result set. The search result contains filenames with seemingly random placement of the searched letters. Is there a way to turn off this functionality in IntelliJ 11.1.2? I would like the search result actually honor the reg exp used?

pic 2012-05-30_02.jpg

Results in, among others:
pic 2012-05-30_03.jpg

6 comments
Comment actions Permalink

pj wrote:

The search result contains filenames with seemingly random placement of the searched letters.

pic 2012-05-30_02.jpg

Results in, among others:
pic 2012-05-30_03.jpg

It's not random. In the navigate to class, file and symbol dialogs, IDEA allows for the use of shorthand to match the first characters in CamelCasedNames (so I can type ccn for that name) and snake_cased_names (so I can type scn for that name). This is typically very useful so you can quickly drill down to classes without needing to type as much. It is especially useful when you have a lot of classes that start with the same name, such as a project, module, or component name. For example, classes such as CustomerServiceFoo, CustomerServiceBar, CustoimerServiceDatabase, etc. In all cases, I can type 'CS' to sart my selection. Works fast.

In the example you show, the '*p' is matching the 'oq_up'. The 'so' then matches, via the snake case matching, the 'srv_order'. I recommend that you take a look at the help document: Help > Help Topics > IntelliJ IDEA Usage Guidelines > Navigating Through Source Code > Navigating to Class, File or Symbol Name (also available on the web at http://www.jetbrains.com/idea/webhelp/navigating-to-class-file-or-symbol-by-name.html) for more information on the syntax that is used. It is also dicsussed in a couple of the "tip of the day" entries.

pj wrote:

I would like the search result actually honor the reg exp used?

It does not use a RegEx. It uses just the wild character '*' and a couple of other special shorthand notations. Again, take a look at the help page I mention above.

pj wrote:
Is there a way to turn off this functionality in IntelliJ 11.1.2?

I do not believe there is a setting to disable this. But I'm not 100% sure of that.

0
Comment actions Permalink

of course, I see that now. I use the CamelCaseSearch all the time myself, but I was not aware of the snake_case_search. Must be something introduced in version 10 or 11? My colleagues do not have the snake_case_search, so I guess there must be a setting somewhere... but where?

0
Comment actions Permalink

This matching was introduced in IDEA 10.5 (see http://blogs.jetbrains.com/idea/2011/04/shiftless-code-completion-and-navigation-in-intellij-idea-105/ for details). And there's no setting for it.

0
Comment actions Permalink

Doesn't the Case senstivite completion setting control this?

Screen Shot 2012-06-05 at 12.09.31 PM.PNG

0
Comment actions Permalink

No, it controls only completion.

0
Comment actions Permalink

Nevermind, that isn't what that setting does.

0

Please sign in to leave a comment.