Commit 8f52239a authored by Tagir Valeev's avatar Tagir Valeev
Browse files

CodeInsightTestUtil: fixture.getElementAtCaret() ->...

CodeInsightTestUtil: fixture.getElementAtCaret() -> fixture.getFile().findElementAt(fixture.getCaretOffset())

fixture.getElementAtCaret() may fail by itself as it looks for name/reference elements which would mask the original failure
parent 69e1ff67
No related merge requests found
Showing with 2 additions and 1 deletion
+2 -1
...@@ -102,7 +102,8 @@ public class CodeInsightTestUtil { ...@@ -102,7 +102,8 @@ public class CodeInsightTestUtil {
List<IntentionAction> availableIntentions = fixture.getAvailableIntentions(); List<IntentionAction> availableIntentions = fixture.getAvailableIntentions();
final IntentionAction intentionAction = findIntentionByText(availableIntentions, action); final IntentionAction intentionAction = findIntentionByText(availableIntentions, action);
if (intentionAction == null) { if (intentionAction == null) {
Assert.fail("Action not found: " + action + " in place: " + fixture.getElementAtCaret() + " among " + availableIntentions); PsiElement element = fixture.getFile().findElementAt(fixture.getCaretOffset());
Assert.fail("Action not found: " + action + " in place: " + element + " among " + availableIntentions);
} }
fixture.launchAction(intentionAction); fixture.launchAction(intentionAction);
fixture.checkResultByFile(after, false); fixture.checkResultByFile(after, false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment