Merge branch 'additional-patterns-for-lines' of https://github.com/jwren/intellij-community into jwren-additional-patterns-for-lines

This commit is contained in:
peter
2017-05-03 20:12:09 +02:00
2 changed files with 3 additions and 2 deletions
@@ -251,6 +251,7 @@ class Intf {
assert getPopupElements(model, 'Bar at line 2') == [file]
assert getPopupElements(model, 'Bar 2:39') == [file]
assert getPopupElements(model, 'Bar#L2') == [file]
assert getPopupElements(model, 'Bar?l=2') == [file]
}
void "test dollar"() {
@@ -340,7 +340,7 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP
}
private static final Pattern patternToDetectLinesAndColumns = Pattern.compile("(.+?)" + // name, non-greedy matching
"(?::|@|,| |#L| on line | at line |:?\\(|:?\\[)" + // separator
"(?::|@|,| |#|#L|\\?l=| on line | at line |:?\\(|:?\\[)" + // separator
"(\\d+)(?:(?:\\D)(\\d+)?)?" + // line + column
"[)\\]]?" // possible closing paren/brace
);
@@ -355,7 +355,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 ") || pattern.contains("?l=")) { // quick test if reg exp should be used
regex = patternToDetectLinesAndColumns;
}