I want to create a plugin for Intellij IDEA. I need to add an action (AnAction
) that will create a class
in Kotlin (not Java) in a custom package
. I have two questions:
class
(from some base class) in a custom package
?One possible way to accomplish this is to use PsiFileFactory.createFileFromText()
to create an in-memory Kotlin file and then to pass that file as a parameter to PsiDirectory.add()
to save it to the filesystem.