diff options
author | Michael Keppler | 2019-08-14 07:49:23 +0000 |
---|---|---|
committer | Michael Keppler | 2019-08-15 12:24:57 +0000 |
commit | 7017d41a622f96dd1c6dcf36b752d8d98af14b5e (patch) | |
tree | e9ff76e40a932a3bde993ccaebe2209e4d00cbe1 | |
parent | 2425626120ca485ba1a64201fbc41eb863fd94c1 (diff) | |
download | eclipse.platform.text-7017d41a622f96dd1c6dcf36b752d8d98af14b5e.tar.gz eclipse.platform.text-7017d41a622f96dd1c6dcf36b752d8d98af14b5e.tar.xz eclipse.platform.text-7017d41a622f96dd1c6dcf36b752d8d98af14b5e.zip |
Bug 550042 - Compare ignored file extensions case insensitiveY20190815-0900
Use case insensitive comparison for ignored file extensions in
quicksearch. Remove the duplications from the default extensions and
sort them for easier reading. Also add some more extensions (.bmp, .com,
.jpeg).
Change-Id: Idc1855921167ed3d1635ba0cae4b66444c76b1cf
Signed-off-by: Michael Keppler <michael.keppler@gmx.de>
-rw-r--r-- | org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java index 4d6c232646e..cd8e72f7e3b 100644 --- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java +++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/core/priority/DefaultPriorityFunction.java @@ -43,10 +43,9 @@ public class DefaultPriorityFunction extends PriorityFunction { * be ignored. */ public String[] ignoredExtensions = { - ".class", ".gif", ".exe", ".png", ".jpg", ".zip", ".jar", ".svg", ".psd", "~", - ".CLASS", ".GIF", ".EXE", ".PNG", ".JPG", ".ZIP", ".JAR", ".SVG", ".PSD", - ".pdf", ".p12", ".odt", ".odp", ".doc", ".pptx", ".ppt", ".bin", ".docx", ".xls", ".xlsx", - ".PDF", ".P12", ".ODT", ".ODP", ".DOC", ".PPTX", ".PPT", ".BIN", ".DOCX", ".XLS", ".XLSX" + "~", ".bin", ".bmp", ".class", ".com", ".doc", ".docx", ".exe", ".gif", + ".jar", ".jpg", ".jpeg", ".odp", ".odt", ".p12", ".pdf", ".png", + ".ppt", ".pptx", ".psd", ".svg", ".xls", ".xlsx", ".zip" }; /** @@ -62,7 +61,7 @@ public class DefaultPriorityFunction extends PriorityFunction { * Strings to be ignored. */ public String[] ignoredNames = { - "bin", "target", "build" + "bin", "build", "target" }; public Set<IResource> ignoredResources = null; @@ -78,7 +77,7 @@ public class DefaultPriorityFunction extends PriorityFunction { } String name = r.getName(); for (String ext : ignoredExtensions) { - if (name.endsWith(ext)) { + if (name.regionMatches(true, name.length() - ext.length(), ext, 0, ext.length())) { return PRIORITY_IGNORE; } } @@ -98,7 +97,7 @@ public class DefaultPriorityFunction extends PriorityFunction { } /** - * Initialise some configurable settings from an instance of QuickSearchPreferences + * Initialize some configurable settings from an instance of QuickSearchPreferences */ public void configure(QuickSearchPreferences preferences) { String[] pref = preferences.getIgnoredExtensions(); |