remove unnecessary parameter from CodeInsightTestFixtureImpl.invokeIntention

GitOrigin-RevId: a70252cbcf56bf83c3133992b22076d5466b5e8e
This commit is contained in:
Peter Gromov
2020-02-24 16:04:21 +00:00
committed by intellij-monorepo-bot
parent 5671873260
commit fbc91d4acf
8 changed files with 10 additions and 11 deletions
@@ -1286,7 +1286,7 @@ public class DaemonRespondToChangesTest extends DaemonAnalyzerTestCase {
List<HighlightInfo.IntentionActionDescriptor> actions =
ShowIntentionsPass.getAvailableFixes(editor, getFile(), -1, ((EditorEx)editor).getExpectedCaretOffset());
final HighlightInfo.IntentionActionDescriptor descriptor = assertOneElement(actions);
CodeInsightTestFixtureImpl.invokeIntention(descriptor.getAction(), getFile(), getEditor(), "");
CodeInsightTestFixtureImpl.invokeIntention(descriptor.getAction(), getFile(), getEditor());
highlightErrors();
assertEmpty(ShowIntentionsPass.getAvailableFixes(editor, getFile(), -1, ((EditorEx)editor).getExpectedCaretOffset()));
@@ -346,7 +346,7 @@ public abstract class DaemonAnalyzerTestCase extends JavaCodeInsightTestCase {
"'.\nAvailable actions: [" +StringUtil.join(ContainerUtil.map(actions, c -> c.getText()), ", ")+ "]\n" +
"HighlightInfos: [" +StringUtil.join(infos, ", ")+"]");
}
CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor, intentionActionName);
CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor);
}
@Nullable
@@ -142,7 +142,7 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
}
protected void invoke(@NotNull IntentionAction action) throws IncorrectOperationException {
CodeInsightTestFixtureImpl.invokeIntention(action, getFile(), getEditor(), action.getText());
CodeInsightTestFixtureImpl.invokeIntention(action, getFile(), getEditor());
}
protected IntentionAction findActionAndCheck(@NotNull ActionHint hint, String testFullPath) {
@@ -683,7 +683,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
@Override
public void launchAction(@NotNull final IntentionAction action) {
EdtTestUtil.runInEdtAndWait(() -> invokeIntention(action, getHostFileAtCaret(), getHostEditor(), action.getText()));
EdtTestUtil.runInEdtAndWait(() -> invokeIntention(action, getHostFileAtCaret(), getHostEditor()));
}
@Override
@@ -1925,7 +1925,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
}
}
public static boolean invokeIntention(@NotNull IntentionAction action, PsiFile file, Editor editor, String actionText) {
public static boolean invokeIntention(@NotNull IntentionAction action, PsiFile file, Editor editor) {
// Test that action will automatically clear the read-only attribute if modification is necessary.
// If your test fails due to this, make sure that your quick-fix/intention
// overrides "getElementToMakeWritable" or has the following line:
@@ -1938,7 +1938,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
try {
ApplicationManager.getApplication().invokeLater(() -> {
try {
result.set(ShowIntentionActionsHandler.chooseActionAndInvoke(file, editor, action, actionText));
result.set(ShowIntentionActionsHandler.chooseActionAndInvoke(file, editor, action, action.getText()));
}
catch (StubTextInconsistencyException e) {
PsiTestUtil.compareStubTexts(e);
@@ -118,7 +118,7 @@ public class InvokeIntention extends ActionOnFile {
String textBefore = changedDocument == null ? null : changedDocument.getText();
Long stampBefore = changedDocument == null ? null : changedDocument.getModificationStamp();
Runnable r = () -> CodeInsightTestFixtureImpl.invokeIntention(intention, file, editor, intention.getText());
Runnable r = () -> CodeInsightTestFixtureImpl.invokeIntention(intention, file, editor);
Disposable disposable = Disposer.newDisposable();
try {
@@ -86,7 +86,7 @@ public class JavaFxFieldToPropertyTest extends DaemonAnalyzerTestCase {
Editor editor = getEditor();
PsiFile file = getFile();
assertTrue(CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor, actionName));
assertTrue(CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor));
checkResultByFile(getTestName(false) + "_after.java");
}
@@ -64,8 +64,7 @@ public class JavaFXCollapseSubtagToAttributeTest extends DaemonAnalyzerTestCase
if (available) {
assertNotNull("Collapse tag '" + tagName + "' to attribute", intentionAction);
assertTrue(CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor,
"Collapse tag '" + tagName + "' to attribute"));
assertTrue(CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor));
checkResultByFile(getTestName(true) + "_after.fxml");
} else {
assertNull(intentionAction);
@@ -65,7 +65,7 @@ public class JavaFXExpandAttributeTest extends DaemonAnalyzerTestCase {
if (available) {
assertNotNull(actionName, intentionAction);
assertTrue(CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor, actionName));
assertTrue(CodeInsightTestFixtureImpl.invokeIntention(intentionAction, file, editor));
checkResultByFile(getTestName(true) + "_after.fxml");
} else {
assertNull(intentionAction);