mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'additional-patterns-for-lines' of https://github.com/jwren/intellij-community into jwren-additional-patterns-for-lines
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user