Use "New Directory" instead of "New Package" in plugin?

CreateDirectoryOrPackageAction chooses to present itself as "New Package" instead of "New Directory" in my custom language plugin.  This custom language doesn't have the same notion of packages as Java, though, so while the net result is the same, that ends up being confusing for users, particularly those unfamiliar with Java packaging.

After a bit of debugging, this seems to be happening because PsiJavaDirectoryFactory.isPackage() is returning true.  That's returning true because ProjectFileIndex.isUnderSourceRootOfType(<parentDir>, JavaModuleSourceRootTypes.SOURCES) returns true.  Unfortunately I'm not really aware of another way to set up my plugin's modules' source roots.

Does anyone know of some way that I can get CreateDirectoryOrPackageAction to treat directories as directories instead of packages for purposes of creation?  Thanks in advance!

Please sign in to leave a comment.