JavaPsiFacade findClass() return null after mkdirs ? Follow
The way mkdirs:
new File(path).mkdirs();
VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(path);
virtualFile.refresh(false, true);
after mkdirs , even JavaPsiFacade.getInstance(project).findClass("java.lang.String",GlobalSearchScope.allScope(project)) return null
JavaPsiFacade.getInstance(project).findClass(packageName, GlobalSearchScope.allScope(project))
Please sign in to leave a comment.
Correct me if I'm wrong, but you've just created new directories - what classes do you expect to find there?
The point is that the scope of “findClass“ is “GlobalSearchScope.allScope(project)”, not just the scope of the directories I just created。
By the way ,there are many classes in the project ,and I can “findClass“ before I created the new directories.
Sorry for the late reply – this thread got lost in a queue. Did you manage to handle it?
I meet the same problem. What " this thread got lost in a queue" means and how to handle it?