From 59ad73d2a1c071bf3ee90d1116eddb78f417e5e7 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 12 Nov 2025 17:12:19 +0100 Subject: [PATCH] IJPL-217839 fix NPE on tear-down - simplify test failure investigation GitOrigin-RevId: 7c445d8dc944de852e5f1e427108bca3333bf8ee --- .../testFramework/fixtures/CodeInsightTestFixture.java | 3 +++ .../fixtures/impl/CodeInsightTestFixtureImpl.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java index fc4c3af7881b..4a4332789cb0 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java @@ -630,6 +630,9 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture { @NotNull PsiManager getPsiManager(); + @Nullable + PsiManager getPsiManagerOrNull(); + /** * @return {@code null} if the only item was auto-completed. * @see #completeBasicAllCarets(Character) diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java index 4999d42436c8..bfa3f2f883cb 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java @@ -1283,6 +1283,11 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig return myPsiManager; } + @Override + public final @Nullable PsiManager getPsiManagerOrNull() { + return myPsiManager; + } + @Override public LookupElement[] complete(@NotNull CompletionType type) { return myEditorTestFixture.complete(type);