return projectBasedFile;
}
Matcher filenameMatcher = PATTERN_FILENAME.matcher(path);
if (filenameMatcher.find()) {
String filename = filenameMatcher.group(1);
GlobalSearchScope projectScope = ProjectScope.getProjectScope(myProject);
PsiFile[] projectFiles = FilenameIndex.getFilesByName(myProject, filename, projectScope);
if (projectFiles.length > 0) {
return projectFiles[0].getVirtualFile();
}
GlobalSearchScope libraryScope = ProjectScope.getLibrariesScope(myProject);
PsiFile[] libraryFiles = FilenameIndex.getFilesByName(myProject, filename, libraryScope);
if (libraryFiles.length > 0) {
return libraryFiles[0].getVirtualFile();
}
}