Changesets · Branches · Tags · Compare
| Changeset | ff45c71a54a7de528ebda80f3845ba1088205b66680ea7923a3abdc6978dc381 |
|---|---|
| Author | Jakub Błach <jakubblach@gmail.com> · 2025-09-18 21:30 +02:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-18 12:30 -07:00 |
| Parents | 8daf96c029f5 |
1 file changed
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/file/FileUtils.kt +8 −2
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | import com.github.continuedev.continueintellijextension.FileType |
| 5 | 5 | import com.intellij.openapi.application.runReadAction |
| 6 | 6 | import com.intellij.openapi.application.runWriteAction |
| 7 | +import com.intellij.openapi.diagnostic.Logger | |
| 7 | 8 | import com.intellij.openapi.fileEditor.FileDocumentManager |
| 8 | 9 | import com.intellij.openapi.fileEditor.FileEditorManager |
| 9 | 10 | import com.intellij.openapi.project.Project |
| @@ -24,10 +25,11 @@ | ||
| 24 | 25 | fun writeFile(fileUri: String, content: String) { |
| 25 | 26 | val path = VfsUtilCore.urlToPath(fileUri) |
| 26 | 27 | val pathDirectory = VfsUtil.getParentDir(path) |
| 27 | - ?: return | |
| 28 | + ?: return LOG.warn("Parent directory is null for $path") | |
| 28 | 29 | val vfsDirectory = VfsUtil.createDirectories(pathDirectory) |
| 30 | + ?: return LOG.warn("Could not create directories for $path") | |
| 29 | 31 | val pathFilename = VfsUtil.extractFileName(path) |
| 30 | - ?: return | |
| 32 | + ?: return LOG.warn("Could not get filename for $path") | |
| 31 | 33 | runWriteAction { |
| 32 | 34 | val newFile = vfsDirectory.createChildData(this, pathFilename) |
| 33 | 35 | VfsUtil.saveText(newFile, content) |
| @@ -107,4 +109,8 @@ | ||
| 107 | 109 | } |
| 108 | 110 | return fileUri |
| 109 | 111 | } |
| 112 | + | |
| 113 | + private companion object { | |
| 114 | + private val LOG = Logger.getInstance(FileUtils::class.java) | |
| 115 | + } | |
| 110 | 116 | } |
| No newline at the end of the file |