From 91aa034a30df83238940b5a0deee52d60341189f Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Tue, 23 Jan 2018 16:38:27 +0300 Subject: [PATCH] support TempFileSystem in LightPlatformCodeInsightFixtureTestCase --- .../src/com/intellij/history/integration/IdeaGateway.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java b/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java index 0a6060810255..221a63349a73 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java @@ -37,6 +37,7 @@ import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.*; import com.intellij.openapi.vfs.encoding.EncodingRegistry; +import com.intellij.openapi.vfs.ex.temp.TempFileSystem; import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.NewVirtualFile; import com.intellij.openapi.vfs.newvfs.events.VFileEvent; @@ -164,7 +165,11 @@ public class IdeaGateway { @Nullable public VirtualFile findVirtualFile(@NotNull String path) { - return LocalFileSystem.getInstance().findFileByPath(path); + VirtualFile file = LocalFileSystem.getInstance().findFileByPath(path); + if (file == null && ApplicationManager.getApplication().isUnitTestMode()) { + return TempFileSystem.getInstance().findFileByPath(path); + } + return file; } @NotNull