mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-89222 Navigate file shall accept files names/path starting with ./
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.navigation
|
||||
|
||||
import com.intellij.ide.actions.GotoFileItemProvider
|
||||
import com.intellij.ide.util.gotoByName.*
|
||||
import com.intellij.lang.java.JavaLanguage
|
||||
import com.intellij.openapi.Disposable
|
||||
@@ -166,6 +167,13 @@ class Intf {
|
||||
|
||||
}
|
||||
|
||||
public void "test accept file paths starting with a dot"() {
|
||||
def file = myFixture.addFileToProject("foo/index.html", "foo")
|
||||
def model = new GotoFileModel(project)
|
||||
def popup = ChooseByNamePopup.createPopup(project, model, new GotoFileItemProvider(project, null, model))
|
||||
assert calcPopupElements(popup, "./foo/in") == [file]
|
||||
}
|
||||
|
||||
public void "test goto file can go to dir"() {
|
||||
PsiFile fooIndex = myFixture.addFileToProject("foo/index.html", "foo")
|
||||
PsiFile barIndex = myFixture.addFileToProject("bar.txt/bar.txt", "foo")
|
||||
|
||||
@@ -67,6 +67,10 @@ public class GotoFileItemProvider extends DefaultChooseByNameItemProvider {
|
||||
}
|
||||
}
|
||||
|
||||
if (pattern.startsWith("./") || pattern.startsWith(".\\")) {
|
||||
pattern = pattern.substring(1);
|
||||
}
|
||||
|
||||
return super.filterElements(base, pattern, everywhere, indicator, consumer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user