PsiFile (@NotNull String fileName, String text) { Path file = ProjectKt.getStateStore(getProject()).getProjectBasePath().resolve(fileName); PathKt.write(file, text); VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByNioFile(file); return PsiManager.getInstance(getProject()).findFile(virtualFile); }