List<VirtualFile> (final String filePath, final Project project) { final VirtualFile file = getByFullPath(filePath); if (file != null) { return Collections.singletonList(file); } //split file by "/" in parts final LinkedList<String> folders = new LinkedList<>(); final StringTokenizer st = new StringTokenizer(filePath, "/", false); String fileName = null; while (st.hasMoreTokens()) { final String pathComponent = st.nextToken(); if (st.hasMoreTokens()) { folders.addFirst(pathComponent); } else { // last token fileName = pathComponent; } } if (fileName == null) { return Collections.emptyList(); } return findFilesClosestToTarget(folders, collectCandidates(project, fileName, true), MIN_PROXIMITY_THRESHOLD); }