This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 415099 - Open Resource: Terminating with "<" or " " (space) does not work for extensions
Summary: Open Resource: Terminating with "<" or " " (space) does not work for extensions
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Anton Leherbauer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 14:29 EDT by David M. Karr CLA
Modified: 2014-05-01 10:17 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David M. Karr CLA 2013-08-14 14:29:31 EDT
I attempted to word the summary in a generic fashion, even though it's somewhat hard to understand that way.  I don't know whether this should be considered a documentation bug, or an "inline help" bug, or a functionality bug.

It's simplest to describe this with an example.  It's very non-obvious to see how to get the dialog to list ONLY all "*.js" files, and not also "*.jsp" or "*.jspx" files.

The solution, which was pointed out to me at <http://www.eclipse.org/forums/index.php/m/1086703/#msg_1086703> is completely nonintuitive.

It's somewhat intuitive to suggest that if you enter "*.js", then perhaps changing it to "*.js " (appending a space) would work.  That doesn't work.

What does work is "*js " (removing the period, but adding the space) or the even more bizarre "*js<".  I never would have thought to remove the period, and certainly not adding "<".

Although these workarounds are non-intuitive, they would be reasonable if the hints in the dialog made it clear that you have to do this.  The "?" help on this dialog is useless.  There's a simple hint on the field in the dialog that just says this:

    ? = any character, * = any string

Perhaps it would be possible to extend this inline help with some statement that made it clear how this works, but I'm having trouble visualizing what that statement would look like.
Comment 1 Paul Webster CLA 2013-08-14 14:41:06 EDT
In this case the '<' is the correct thing to add to mark that the match should be at the end of the line.  The Open Type Dialog works the same way.

It should be added to the dialog help or to the hint string.

PW
Comment 2 Dani Megert CLA 2013-08-15 08:26:22 EDT
(In reply to comment #1)
> In this case the '<' is the correct thing to add to mark that the match
> should be at the end of the line.  The Open Type Dialog works the same way.
> 
> It should be added to the dialog help or to the hint string.
> 
> PW

It is in the F1 help, but unfortunately it doesn't work for file extensions.
Comment 3 David M. Karr CLA 2013-08-15 10:00:13 EDT
Would you mind clarifying that statement?  I don't understand what that means.
Comment 4 Dani Megert CLA 2013-08-15 10:01:45 EDT
(In reply to comment #3)
> Would you mind clarifying that statement?  I don't understand what that
> means.

"<" and " " are described in the F1 help, but it does not work if the pattern also includes file extensions, like e.g. "*.js". It's a bug in our code.
Comment 5 David M. Karr CLA 2013-08-15 11:07:12 EDT
I see.  After viewing the initial F1 info, and you think to click the "Open Resource Dialog" in the "See Also" link, it does have the following statement in the "Wildcards" section:

'terminating "<" or " " (space) to prevent the automatic prefix matching, e.g. "M*file<" to match Makefile and MockFile but not MakeTheFiles'

So it might be good to make this functionality a little more visible, but there is also a bug that prevents this from working with the "*.js<" pattern, although it does with the less intuitive "*js<" pattern.  Was a bug ever filed for that?
Comment 6 Dani Megert CLA 2013-08-15 11:08:48 EDT
(In reply to comment #5)
> So it might be good to make this functionality a little more visible, but
> there is also a bug that prevents this from working with the "*.js<"
> pattern, although it does with the less intuitive "*js<" pattern.  Was a bug
> ever filed for that?

This bug report covers that.
Comment 7 Martin Oberhuber CLA 2013-09-20 11:28:07 EDT
CQ:WIND00433784
Comment 8 Anton Leherbauer CLA 2014-03-24 11:17:42 EDT
I pushed a patch to gerrit for review:
https://git.eclipse.org/r/23807

This fixes also camel case patterns with a folder prefix, like eg. */FR

I noticed that the basename part is matched as prefix, ie. th.txt would match both this.txt and that.txt. While th.txt< would neither match this.txt nor that.txt.
I was not sure if this is expected/desired and left it unchanged.
Comment 10 Paul Webster CLA 2014-05-01 10:17:11 EDT
In 4.4.0.I20140501-0200

PW