How to search file by file name in project's root directory?

I get file name without path information,just like "index.jsp". I want to search all files with this name in project's root directory,just like CtrlShiftN. Is there api to implement this function in Open API?

0

Just for the sake of anybody else wo will search the forum for an answer:
Look at the methods in PsiShortNamesCache.
You get this cache by using
PsiManager.getInstance(project).getShortNamesCache()

0
Avatar
Permanently deleted user

Current version of PsiManager doesn't have getShortNamesCache() method.
What is currently the right way to find files by name?

0

com.intellij.psi.search.PsiShortNamesCache#getFilesByName

0

请先登录再写评论。