API to resolve Class Names Follow
In IDEA editor, when I type a Java Class Name, Idea will automatically scan the project's class path and suggest the fully qualified class names, so that when I press Alt + Enter, it will display all the possible candidates for that particular class name.
I was wondering, is there an API to obtain this list of fully qualifies class names for a String I type in Editor?
Please sign in to leave a comment.
Yes, it's PsiShortNamesCache#getClassesByName/processClassesByName
As for the getClassesByName() method, I need the complete name of the class. Suppose I want to find classes named "HashMap", I have to give "HashMap" as input for that method. But I have seen in IDEA editor when I type the letter "H" it will show all the classes starting with that letter.
I suppose this is possible with processClassesByName() method. But it takes considerable amount of time. Is there a way to limit the search result, so that the search would be faster in this methods. I am using ProjectScope.allScope() as my scope.