| Summary: | [Dialogs] Open Resource now interprets "." as "*.", unlike 3.5 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Chris West (Faux) <eclipse> | ||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Susan McCourt <susan> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | bokowski, daniel_megert, markus.kell.r, remy.suen | ||||
| Version: | 3.6 | Flags: | daniel_megert:
review+
|
||||
| Target Milestone: | 3.7 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows Server 2003 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
In 3.6, we still show A.java on top, so the first match didn't change (you just get more matches). The added benefit of the new behavior is that you not only get free prefix matching at the end of the whole file name, but you now get it separately for the base name and for the extension. This is especially useful for camel case matches: In 3.5, it was e.g. not possible to open AbstractBar.java by just typing "AB.java". It worked for "AB", but there was no way to add a file extension without having to change the pattern for the base name. This is similar to how the Open Type dialog works. There, we also split the pattern at the "." that separates package and type name, and you get free prefix matching for both parts. To avoid automatic prefix matching, you can add a "<" or a " " (space) at the end of a pattern. E.g. "A<.java" reduces the match count, but it still leaves some unwanted matches, because "A" is also a valid camel case prefix, so this pattern also matches e.g. "Argument.java". I've released a fix to HEAD of FilteredResourcesSelectionDialog, such that a "<" or " " at the end of the whole pattern disables the separate prefix matching for base name and extension. So "A.java<" will not match any A*.java files any more. Mmm, apparently I wasn't looking very carefully. The first match does change, but only if you have recently used files. i.e. you get: AbstractFoo.java AbstractBar.java AllTests.java AllTests.java AllTests.java AllTests.java ------------------- Workspace matches ---------------- A.java ... , which is what I was actually complaining about. :) Why " " or "<" instead of "$", regex style (which I actually tried the first time I came across this)? But, cool, anyway. >Why " " or "<" instead of "$", regex style
Because this is used in 'Open Type' for years.
> The first match does change, but only if you have recently used files. You're right, but I don't see how we could improve this without losing the new functionality. The workaround in 3.7 is to append " " or "<". > >Why " " or "<" instead of "$", regex style > Because this is used in 'Open Type' for years. And because it was already like this in the Open Resource dialog since at least 3.3 (although this has only been documented properly in 3.6), and because "$" is a valid character in a Java type name but the others are not. And note that the only wildcards supported in the pattern are the glob-style ? and * (i.e. no regexes). Verified in I20100802-1800: found some additional issues, see bug 321564. Makes sense to fix regression in 3.6.1 RC2. Boris, please speak up if you disagree. Created attachment 177229 [details]
Fix for 3.6.1
+1 for fixing in 3.6.1 RC2. Could you please open a new bug for the 3.6.1 work and keep this one with a target milestone of 3.7 M1? Platform UI uses "clone this bug" for that purpose. The reason is that you can later query for which bugs got fixed in which release, and you need two bugs if there are two target milestones for which we applied the fix. > Could you please open a new bug for the 3.6.1 work ... Sure, opened bug 323539. |
Build Identifier: 20100617-1415 In 3.5, ctrl+shift+r Open Resource "A.java" would show only files called "A.java". In 3.6, it shows every java file in the workspace starting with A, AbstractFoo.java AbstractBar.java AllTests.java AllTests.java AllTests.java AllTests.java A.java etc. This behaviour is similar to Open Type, which has special processing for "." to mean "a package, or multiple packages, separator"? I believe that this should be reverted to the pre-Helios behaviour, as there already exists syntax to do the new behaviour both now and before ("A*.java"). Reproducible: Always Steps to Reproduce: 1. Have plenty of files in your workspace. 2. Ctrl+shift+r Open Resource A.java 3. See files not called A.java in the results.