IDEA-162418 Enhanced go to file formats

This commit is contained in:
peter
2016-11-21 18:11:28 +01:00
parent 7a8bd02590
commit 221f557fde
2 changed files with 5 additions and 3 deletions
@@ -238,6 +238,8 @@ class Intf {
assert getPopupElements(model, 'Bar(2)') == [file]
assert getPopupElements(model, 'Bar on line 2') == [file]
assert getPopupElements(model, 'Bar at line 2') == [file]
assert getPopupElements(model, 'Bar 2:39') == [file]
assert getPopupElements(model, 'Bar#L2') == [file]
}
void "test dollar"() {
@@ -338,8 +338,8 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP
}
private static final Pattern patternToDetectLinesAndColumns = Pattern.compile("(.+?)" + // name, non-greedy matching
"(?::|@|,| on line | at line |:?\\(|:?\\[)" + // separator
"(\\d+)?(?:(?:\\D)(\\d+)?)?" + // line + column
"(?::|@|,| |#L| on line | at line |:?\\(|:?\\[)" + // separator
"(\\d+)(?:(?:\\D)(\\d+)?)?" + // line + column
"[)\\]]?" // possible closing paren/brace
);
public static final Pattern patternToDetectAnonymousClasses = Pattern.compile("([\\.\\w]+)((\\$[\\d]+)*(\\$)?)");
@@ -353,7 +353,7 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP
public static String getTransformedPattern(String pattern, ChooseByNameModel model) {
Pattern regex = null;
if (StringUtil.containsAnyChar(pattern, ":,;@[(") || pattern.contains(" line ")) { // quick test if reg exp should be used
if (StringUtil.containsAnyChar(pattern, ":,;@[( #") || pattern.contains(" line ")) { // quick test if reg exp should be used
regex = patternToDetectLinesAndColumns;
}