File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/kotlin/org/domaframework/doma/intellij/common/psi Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ class PsiDaoMethod(
200200 PsiManager
201201 .getInstance(psiProject)
202202 .findDirectory(virtualFile) ? : return @runWriteCommandAction
203+ sqlOutputDirPath.findFile(sqlFileName)?.delete()
203204 val sqlVirtualFile = sqlOutputDirPath.createFile(sqlFileName).virtualFile ? : return @runWriteCommandAction
204205 FileEditorManager
205206 .getInstance(psiProject)
@@ -214,8 +215,9 @@ class PsiDaoMethod(
214215 */
215216 private fun writeEmptyElementSqlFile (sqlVirtualFile : VirtualFile ) {
216217 val psiFile = psiProject.findFile(sqlVirtualFile) ? : return
218+ val documentManager = PsiDocumentManager .getInstance(psiProject)
217219 val document =
218- PsiDocumentManager .getInstance(psiProject) .getDocument(psiFile) ? : return
220+ documentManager .getDocument(psiFile) ? : return
219221 WriteCommandAction .runWriteCommandAction(psiProject) {
220222 document.insertString(0 , " -- Generated By Doma Tools" )
221223 }
You can’t perform that action at this time.
0 commit comments