I need to generate some source files so I'm hooking into PsiAugmentProvider. The generated files need to be in a different folder hierarchy. I'm thinking I'll use PackageUtil.findOrCreateDirectoryForPackage() to first create the directories for the package and then do JavaDirectoryService.getInstance().createClass() to generate the source file. Trouble is I can't get a handle for the current module which findOrCreateDirectoryForPackage() needs. How do I get that?
Also, I'm not very sure how to go about this. Does this approach look right?