Is it possible to remove (filter) files in "Go to file" pop-up dialog?

In my plugin I need to filter some files from project tree view (I do this via the TreeStructureProvider) but I'm not able to find a way how to remove the files also from the "Go to file" pop-up dialog.

Is there any way how to do it?

Thanks.

1 comment

Well, there might be a way: I suppose IDEA uses the PsiShortNamesCache to build the list of available files for the project. It contains the methods getFilesByName() and getAllFileNames() which you would want to filter. To accomplish that you can try to register your custom PsiShortNamesCache implementation using com.intellij.psi.PsiManager#registerShortNamesCache() (read its Javadoc!) that does the filtering of file names and delegates the rest to the original.

However, there's no warranty that this actually works and please be aware that this might cause other functionality to break that relies on this cache to return those files. Use at your own risk.

Sascha

0

Please sign in to leave a comment.