diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/LSPIJUtils.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/LSPIJUtils.java index f3edb724c..919a1b1d9 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/LSPIJUtils.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/LSPIJUtils.java @@ -21,6 +21,7 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.impl.light.LightRecordField; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.eclipse.lsp4j.*; import org.eclipse.lsp4j.jsonrpc.messages.Either; @@ -357,6 +358,7 @@ public static void applyWorkspaceEdit(WorkspaceEdit edit, String label) { */ public static @Nullable VirtualFile createFile(URI fileUri) throws IOException { File newFile = new File(fileUri); + FileUtils.createParentDirectories(newFile); newFile.createNewFile(); return VfsUtil.findFileByIoFile(newFile, true); }