Search code examples
intellij-ideaintellij-plugin

intellij plugin using TreeClassChooserFactory not show recommended class?


I'm writing a intellij plugin to let people choose a class, I find the code the move method in intellij open source code.

The move method picture is like this which will show all project class. enter image description here

but when I using the following code the pic is this enter image description here

There is no recommend class, after I type some text, still nothing.

TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createWithInnerClassesScopeChooser(
                        "choose serviceClass", GlobalSearchScope.projectScope(myProject), new ClassFilter() {
                            public boolean isAccepted(PsiClass aClass) {
                                return aClass.getParent() instanceof PsiFile && !aClass.isInterface();
                            }
                        }, srcClass);
                chooser.selectDirectory(pojoClass.getContainingFile().getContainingDirectory());
                chooser.showDialog();

Solution

  • That seems to be a bug in the IDE, fixed in the upcoming 2017.2 release.