Apply hack to restore mapping between PsiFiles and VirtualFiles, otherwise built-ins psi elements will become invalid in next test.

This commit is contained in:
Ilya Gorbunov
2015-10-21 18:14:57 +03:00
parent 16d56355c3
commit 84492fd311
@@ -26,6 +26,7 @@ import com.intellij.openapi.util.text.StringUtil;
import org.apache.commons.lang.SystemUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.idea.completion.test.CompletionTestUtilKt;
import org.jetbrains.kotlin.idea.test.RunnableWithException;
import org.jetbrains.kotlin.idea.test.TestUtilsKt;
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
@@ -60,6 +61,16 @@ public class KotlinConfidenceTest extends LightCompletionTestCase {
TestUtilsKt.invalidateLibraryCache(getProject());
}
@Override
protected void tearDown() throws Exception {
TestUtilsKt.unInvalidateBuiltinsAndStdLib(getProject(), new RunnableWithException() {
@Override
public void run() throws Exception {
KotlinConfidenceTest.super.tearDown();
}
});
}
protected void doTest() {
boolean completeByChars = CodeInsightSettings.getInstance().SELECT_AUTOPOPUP_SUGGESTIONS_BY_CHARS;