mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DaemonAnalyzerTestCase.findAndInvokeIntentionAction: lazily calculate error message
to workaround invalid unrelated PSI access in JSIntentionPerformanceTest
This commit is contained in:
@@ -355,12 +355,13 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase {
|
||||
List<IntentionAction> actions = getIntentionActions(infos, editor, file);
|
||||
IntentionAction intentionAction = LightQuickFixTestCase.findActionWithText(actions, intentionActionName);
|
||||
|
||||
String message = String.format("Could not find action by name %s.\n" +
|
||||
"Actions: [%s]\n" +
|
||||
"HighlightInfos: [%s]", intentionActionName,
|
||||
StringUtil.join(ContainerUtil.map(actions, c -> c.getText()), ", "),
|
||||
StringUtil.join(infos, ", "));
|
||||
assertNotNull(message, intentionAction);
|
||||
if (intentionAction == null) {
|
||||
fail(String.format("Could not find action by name %s.\n" +
|
||||
"Actions: [%s]\n" +
|
||||
"HighlightInfos: [%s]", intentionActionName,
|
||||
StringUtil.join(ContainerUtil.map(actions, c -> c.getText()), ", "),
|
||||
StringUtil.join(infos, ", ")));
|
||||
}
|
||||
CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor, intentionActionName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user