The plugin verifier is hopefully going to become useful in time but at the minute it’s indicating a problem with the Intellij API rather than plugin developers use of the publicly accessible classes and methods that have been made available.
It would be good to get some acknowledgement of the problem from Jetbrains as the current state of things is causing needless headache for the many developers that are working on plugins for the Jetbrains eco-system.
Here’s an example of how annoying this process is:
I have a plugin that currently uses com.intellij.openapi.roots.impl.DirectoryIndex and then calls getDirectoriesByPackageName(qualifiedName, true). The verifier has indicated that I should not use it. It’s marked as @Internal and @Obsolete so I look for the alternative. By looking at the source on intellij-community I can see that I’m expected to use com.intellij.openapi.roots.ProjectFileIndex and other APIs instead. So I take a look at ProjectFileIndex but it doesn’t have the functionality I’m currently using.
Back on DirectoryIndex the Javadoc for getDirectoriesByPackageName indicates that WorkspaceFileIndexEx#getDirectoriesByPackageName(String, boolean) is the alternative. Awesome, or so I thought, because the WorkspaceFileIndexEx approach also results in verification errors (although it isn’t actually annotated as internal). So I looked for another option and found PlatformPackageUtil.getDirectoriesByPackageName(qualifiedName, true, project) but alas this is also marked as internal use only.
This example is just one of many verification errors for which I’ve been digging around to find a solution. Some of the time, after having investigated for a while, I find there’s no available alternative at all.
