mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add project & editor paramaters to Intention.processIntention
This commit is contained in:
@@ -19,15 +19,16 @@ import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.openapi.editor.CaretModel;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.annotator.intentions.QuickfixUtil;
|
||||
import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.BoolUtils;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
import org.jetbrains.plugins.groovy.annotator.intentions.QuickfixUtil;
|
||||
|
||||
|
||||
public abstract class Intention implements IntentionAction {
|
||||
@@ -51,10 +52,10 @@ public abstract class Intention implements IntentionAction {
|
||||
return;
|
||||
}
|
||||
assert element.isValid() : element;
|
||||
processIntention(element);
|
||||
processIntention(element, project, editor);
|
||||
}
|
||||
|
||||
protected abstract void processIntention(@NotNull PsiElement element)
|
||||
protected abstract void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException;
|
||||
|
||||
@NotNull
|
||||
|
||||
+7
-3
@@ -15,15 +15,19 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.closure;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyRecursiveElementVisitor;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameterList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyRecursiveElementVisitor;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -36,7 +40,7 @@ public class ConvertClosureArgToItIntention extends Intention {
|
||||
return new SingleArgClosurePredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrClosableBlock closure =
|
||||
(GrClosableBlock) element;
|
||||
|
||||
+14
-22
@@ -23,7 +23,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.refactoring.rename.inplace.VariableInplaceRenamer;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -53,27 +52,8 @@ public class EachToForIntention extends Intention {
|
||||
return new EachToForPredicate();
|
||||
}
|
||||
|
||||
private GrVariable var = null;
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
super.invoke(project, editor, file);
|
||||
if (var == null) return;
|
||||
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return;
|
||||
|
||||
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
|
||||
final Document doc = documentManager.getDocument(file);
|
||||
if (doc == null) return;
|
||||
|
||||
|
||||
documentManager.doPostponedOperationsAndUnblockDocument(doc);
|
||||
editor.getCaretModel().moveToOffset(var.getTextOffset());
|
||||
new VariableInplaceRenamer(var, editor).performInplaceRename();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
final GrMethodCallExpression expression = (GrMethodCallExpression)element;
|
||||
final GrClosableBlock block = expression.getClosureArguments()[0];
|
||||
final GrParameterList parameterList = block.getParameterList();
|
||||
@@ -114,7 +94,19 @@ public class EachToForIntention extends Intention {
|
||||
final GrStatement statement = elementFactory.createStatementFromText(builder.toString());
|
||||
final GrForStatement forStatement = (GrForStatement)expression.replaceWithStatement(statement);
|
||||
final GrForClause clause = forStatement.getClause();
|
||||
this.var = clause.getDeclaredVariables()[0];
|
||||
GrVariable variable = clause.getDeclaredVariables()[0];
|
||||
|
||||
if (variable == null) return;
|
||||
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return;
|
||||
|
||||
final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
|
||||
final Document doc = documentManager.getDocument(element.getContainingFile());
|
||||
if (doc == null) return;
|
||||
|
||||
documentManager.doPostponedOperationsAndUnblockDocument(doc);
|
||||
editor.getCaretModel().moveToOffset(variable.getTextOffset());
|
||||
new VariableInplaceRenamer(variable, editor).performInplaceRename();
|
||||
}
|
||||
|
||||
private static class EachToForPredicate implements PsiElementPredicate {
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.closure;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -39,7 +41,7 @@ public class ForToEachIntention extends Intention {
|
||||
return new ForToEachPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrForStatement parentStatement =
|
||||
(GrForStatement) element;
|
||||
|
||||
+6
-2
@@ -15,10 +15,14 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.closure;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
@@ -32,7 +36,7 @@ public class MakeClosureCallExplicitIntention extends Intention {
|
||||
return new ImplicitClosureCallPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrMethodCallExpression expression =
|
||||
(GrMethodCallExpression) element;
|
||||
|
||||
+6
-2
@@ -15,10 +15,14 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.closure;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
@@ -33,7 +37,7 @@ public class MakeClosureCallImplicitIntention extends Intention {
|
||||
return new ExplicitClosureCallPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrMethodCallExpression expression =
|
||||
(GrMethodCallExpression) element;
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.comments;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiComment;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -38,7 +40,7 @@ public class ChangeToCStyleCommentIntention extends Intention {
|
||||
return new EndOfLineCommentPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final PsiComment selectedComment = (PsiComment) element;
|
||||
PsiComment firstComment = selectedComment;
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.comments;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiComment;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -31,7 +33,7 @@ public class ChangeToEndOfLineCommentIntention extends Intention {
|
||||
return new CStyleCommentPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final PsiComment comment = (PsiComment) element;
|
||||
final JavaPsiFacade manager = JavaPsiFacade.getInstance(comment.getProject());
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -29,7 +31,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpres
|
||||
* @author ilyas
|
||||
*/
|
||||
public class ConditionalToElvisIntention extends Intention {
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
final GrConditionalExpression expr =
|
||||
(GrConditionalExpression) element;
|
||||
|
||||
|
||||
+5
-3
@@ -15,16 +15,18 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.MutablyNamedIntention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.BoolUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ComparisonUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ParenthesesUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.MutablyNamedIntention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrBinaryExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
@@ -47,7 +49,7 @@ public class DemorgansLawIntention extends MutablyNamedIntention {
|
||||
return new ConjunctionPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
GrBinaryExpression exp =
|
||||
(GrBinaryExpression) element;
|
||||
|
||||
+6
-2
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
|
||||
@@ -33,7 +37,7 @@ public class ExpandBooleanIntention extends Intention {
|
||||
return new ExpandBooleanPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrStatement containingStatement = (GrStatement) element;
|
||||
if (ExpandBooleanPredicate.isBooleanAssignment(containingStatement)) {
|
||||
|
||||
+6
-2
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.MutablyNamedIntention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ComparisonUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrBinaryExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
|
||||
@@ -41,7 +45,7 @@ public class FlipComparisonIntention extends MutablyNamedIntention {
|
||||
return new ComparisonPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrBinaryExpression exp =
|
||||
(GrBinaryExpression) element;
|
||||
|
||||
+6
-2
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.BoolUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrConditionalExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
|
||||
@@ -31,7 +35,7 @@ public class FlipConditionalIntention extends Intention {
|
||||
return new ConditionalPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrConditionalExpression exp =
|
||||
(GrConditionalExpression) element;
|
||||
|
||||
+6
-2
@@ -15,12 +15,16 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.MutablyNamedIntention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrBinaryExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
@@ -45,7 +49,7 @@ public class FlipConjunctionIntention extends MutablyNamedIntention {
|
||||
return new ConjunctionPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrBinaryExpression exp =
|
||||
(GrBinaryExpression) element;
|
||||
|
||||
+7
-3
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrBlockStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrIfStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrBlockStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
|
||||
|
||||
public class MergeElseIfIntention extends Intention {
|
||||
@@ -31,7 +35,7 @@ public class MergeElseIfIntention extends Intention {
|
||||
return new MergeElseIfPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrIfStatement parentStatement = (GrIfStatement) element;
|
||||
GrBlockStatement elseBlockStatement = (GrBlockStatement) parentStatement.getElseBranch();
|
||||
|
||||
+6
-2
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ConditionalUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ParenthesesUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrIfStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
@@ -34,7 +38,7 @@ public class MergeIfAndIntention extends Intention {
|
||||
return new MergeIfAndPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrIfStatement parentStatement =
|
||||
(GrIfStatement) element;
|
||||
|
||||
+4
-2
@@ -15,14 +15,16 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ComparisonUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.MutablyNamedIntention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.intentions.utils.ComparisonUtils;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrBinaryExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
|
||||
@@ -42,7 +44,7 @@ public class NegateComparisonIntention extends MutablyNamedIntention {
|
||||
return new ComparisonPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrBinaryExpression exp =
|
||||
(GrBinaryExpression) element;
|
||||
|
||||
+6
-2
@@ -15,10 +15,14 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.control;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrIfStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
|
||||
@@ -29,7 +33,7 @@ public class SplitElseIfIntention extends Intention {
|
||||
return new SplitElseIfPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrIfStatement parentStatement = (GrIfStatement) element;
|
||||
assert parentStatement != null;
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -40,7 +42,7 @@ public class ConvertClosureToMethodIntention extends Intention {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
element = element.getParent();
|
||||
StringBuilder builder = new StringBuilder(element.getTextLength());
|
||||
final GrField field = (GrField)element;
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.MethodSignatureUtil;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
@@ -50,7 +52,7 @@ public class ConvertConcatenationToGstringIntention extends Intention {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
StringBuilder builder = new StringBuilder(element.getTextLength());
|
||||
if (element instanceof GrBinaryExpression) {
|
||||
performIntention((GrBinaryExpression)element, builder);
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiType;
|
||||
@@ -44,7 +46,7 @@ public class ConvertGStringToStringIntention extends Intention {
|
||||
return new ConvertibleGStringLiteralPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
final GrLiteral exp = (GrLiteral)element;
|
||||
IntentionUtils.replaceExpression(convertGStringLiteralToStringLiteral(exp), exp);
|
||||
}
|
||||
|
||||
+6
-2
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral;
|
||||
|
||||
import java.math.BigInteger;
|
||||
@@ -31,7 +35,7 @@ public class ConvertIntegerToDecimalIntention extends Intention {
|
||||
return new ConvertIntegerToDecimalPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrLiteral exp = (GrLiteral) element;
|
||||
@NonNls String textString = exp.getText();
|
||||
|
||||
+6
-2
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral;
|
||||
|
||||
import java.math.BigInteger;
|
||||
@@ -32,7 +36,7 @@ public class ConvertIntegerToHexIntention extends Intention {
|
||||
return new ConvertIntegerToHexPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrLiteral exp = (GrLiteral) element;
|
||||
String textString = exp.getText();
|
||||
|
||||
+6
-2
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral;
|
||||
|
||||
import java.math.BigInteger;
|
||||
@@ -32,7 +36,7 @@ public class ConvertIntegerToOctalIntention extends Intention {
|
||||
return new ConvertIntegerToOctalPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrLiteral exp = (GrLiteral) element;
|
||||
@NonNls String textString = exp.getText();
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -31,7 +33,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrM
|
||||
*/
|
||||
public class ConvertJavaStyleArrayIntention extends Intention {
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
final GrClosableBlock block = ((GrMethodCallExpression)element).getClosureArguments()[0];
|
||||
final String text = block.getText();
|
||||
int start = block.getLBrace().getStartOffsetInParent() + 1;
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -40,7 +42,7 @@ public class ConvertMethodToClosureIntention extends Intention {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
element = element.getParent();
|
||||
final GrMethod method = (GrMethod)element;
|
||||
StringBuilder builder = new StringBuilder(method.getTextLength());
|
||||
|
||||
+6
-2
@@ -15,10 +15,14 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral;
|
||||
|
||||
public class ConvertStringToGStringIntention extends Intention {
|
||||
@@ -28,7 +32,7 @@ public class ConvertStringToGStringIntention extends Intention {
|
||||
return new StringLiteralPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
final GrLiteral exp = (GrLiteral)element;
|
||||
final String textString = exp.getText();
|
||||
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -33,7 +35,7 @@ public class IndexedExpressionConversionIntention extends Intention {
|
||||
return new IndexedExpressionConversionPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
|
||||
final GrIndexProperty arrayIndexExpression = (GrIndexProperty) element;
|
||||
|
||||
+7
-3
@@ -15,15 +15,19 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.*;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.Intention;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.IntentionUtils;
|
||||
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrMethodCallExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
|
||||
public class IndexingMethodConversionIntention extends Intention {
|
||||
|
||||
@@ -32,7 +36,7 @@ public class IndexingMethodConversionIntention extends Intention {
|
||||
return new IndexingMethodConversionPredicate();
|
||||
}
|
||||
|
||||
public void processIntention(@NotNull PsiElement element)
|
||||
public void processIntention(@NotNull PsiElement element, Project project, Editor editor)
|
||||
throws IncorrectOperationException {
|
||||
final GrMethodCallExpression callExpression =
|
||||
(GrMethodCallExpression) element;
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,7 +41,7 @@ public class RemoveParenthesesFromMethodCallIntention extends Intention {
|
||||
return element instanceof GrStatementOwner;
|
||||
}
|
||||
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
final GrMethodCallExpression expression = (GrMethodCallExpression) element;
|
||||
final StringBuilder newStatementText = new StringBuilder();
|
||||
newStatementText.append(expression.getInvokedExpression().getText());
|
||||
|
||||
+3
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.conversions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -36,7 +38,7 @@ public class RemoveUnnecessaryBracesInGStringIntention extends Intention {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
GrStringUtil.removeUnnecessaryBracesInGString((GrString)element);
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.style;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -31,6 +33,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrCall;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrMethodCallExpression;
|
||||
|
||||
import static org.jetbrains.plugins.groovy.lang.psi.util.PsiElementUtil.*;
|
||||
|
||||
/**
|
||||
@@ -42,7 +45,7 @@ public class JavaStylePropertiesInvocationIntention extends Intention {
|
||||
return super.isStopElement(element) || element instanceof GrClosableBlock;
|
||||
}
|
||||
|
||||
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
|
||||
protected void processIntention(@NotNull PsiElement element, Project project, Editor editor) throws IncorrectOperationException {
|
||||
assert element instanceof GrMethodCallExpression || element instanceof GrApplicationStatement;
|
||||
GrCall call = ((GrCall) element);
|
||||
GrExpression invoked = call instanceof GrMethodCallExpression ?
|
||||
|
||||
+3
-2
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.intentions.style;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.infos.CandidateInfo;
|
||||
@@ -51,12 +52,12 @@ public class ReplaceAbstractClassInstanceByMapIntention extends Intention {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processIntention(@NotNull PsiElement psiElement) throws IncorrectOperationException {
|
||||
Project project = psiElement.getProject();
|
||||
protected void processIntention(@NotNull PsiElement psiElement, Project project, Editor editor) throws IncorrectOperationException {
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments();
|
||||
|
||||
final GrNewExpression newExpr = (GrNewExpression)psiElement;
|
||||
GrCodeReferenceElement ref = newExpr.getReferenceElement();
|
||||
assert ref != null;
|
||||
|
||||
final PsiElement resolved = ref.resolve();
|
||||
assert resolved instanceof PsiClass;// && ((PsiClass)resolved).isInterface();
|
||||
|
||||
+2
-2
@@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.intentions.style.parameterToEntry;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
@@ -83,8 +84,7 @@ public class ConvertParameterToMapEntryIntention extends Intention {
|
||||
@NonNls private static final String MAP_TYPE_TEXT = "Map";
|
||||
@NonNls private static final String[] MY_POSSIBLE_NAMES = new String[]{"attrs", "args", "params", "map"};
|
||||
|
||||
protected void processIntention(@NotNull final PsiElement element) throws IncorrectOperationException {
|
||||
final Project project = element.getProject();
|
||||
protected void processIntention(@NotNull final PsiElement element, final Project project, Editor editor) throws IncorrectOperationException {
|
||||
// Method or closure to be refactored
|
||||
final GrParametersOwner owner = PsiTreeUtil.getParentOfType(element, GrParametersOwner.class);
|
||||
final Collection<PsiElement> occurrences = new ArrayList<PsiElement>();
|
||||
|
||||
Reference in New Issue
Block a user