PsiFile (@NotNull String name, @NotNull String content) { PsiFile createdFile = null; try { createdFile = createFile(myModule, myCurrentLevelDirectory.getVirtualFile(), name, content); } catch (IOException e) { throw new RuntimeException(e); } getCurrentDirectoryFiles().add(createdFile); return createdFile; }