Create file from PsiFile with path
Dear JetBrains Developer
I'm creating file on disk by PsiFile and I created it, but now I want to create file in special path, but i can not in any function create file with path.
This is my code
PsiFileFactory psiFileFactory = PsiFileFactory.getInstance(e.getProject());
PsiFile psiFile = psiFileFactory.createFileFromText("FileName.kt", KotlinLanguage.INSTANCE, utils.defaultContent);
PsiDirectory psiDirectory = PsiDirectoryFactory.getInstance(e.getProject()).createDirectory(e.getProject().getBaseDir());
psiDirectory.add(psiFile);
Please help me thank you in advance
Please sign in to leave a comment.
Please clarify, what is "special path" in
I want to create file in special path, but i can not in any function create file with path.