Move intention-related classes and tests to "intentions" directory
This commit is contained in:
@@ -38,7 +38,7 @@ import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRenderer
|
||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveTest;
|
||||
import org.jetbrains.jet.modules.xml.AbstractModuleXmlParserTest;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationTest;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationTest;
|
||||
import org.jetbrains.jet.plugin.codeInsight.surroundWith.AbstractSurroundWithTest;
|
||||
import org.jetbrains.jet.plugin.folding.AbstractKotlinFoldingTest;
|
||||
import org.jetbrains.jet.plugin.hierarchy.AbstractHierarchyTest;
|
||||
@@ -330,25 +330,25 @@ public class GenerateTests {
|
||||
"idea/tests/",
|
||||
"CodeTransformationsTestGenerated",
|
||||
AbstractCodeTransformationTest.class,
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/folding/ifToAssignment", "doTestFoldIfToAssignment"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/folding/ifToReturn", "doTestFoldIfToReturn"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/folding/ifToReturnAsymmetrically", "doTestFoldIfToReturnAsymmetrically"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/folding/whenToAssignment", "doTestFoldWhenToAssignment"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/folding/whenToReturn", "doTestFoldWhenToReturn"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignmentToIf", "doTestUnfoldAssignmentToIf"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignmentToWhen", "doTestUnfoldAssignmentToWhen"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/unfolding/propertyToIf", "doTestUnfoldPropertyToIf"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/unfolding/propertyToWhen", "doTestUnfoldPropertyToWhen"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/unfolding/returnToIf", "doTestUnfoldReturnToIf"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/unfolding/returnToWhen", "doTestUnfoldReturnToWhen"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/ifWhen/ifToWhen", "doTestIfToWhen"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/ifWhen/whenToIf", "doTestWhenToIf"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/when/flatten", "doTestFlattenWhen"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/when/introduceSubject", "doTestIntroduceWhenSubject"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/branched/when/eliminateSubject", "doTestEliminateWhenSubject"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/declarations/split", "doTestSplitProperty"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/declarations/join", "doTestJoinProperty"),
|
||||
testModel("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses", "doTestRemoveUnnecessaryParentheses")
|
||||
testModel("idea/testData/intentions/branched/folding/ifToAssignment", "doTestFoldIfToAssignment"),
|
||||
testModel("idea/testData/intentions/branched/folding/ifToReturn", "doTestFoldIfToReturn"),
|
||||
testModel("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically", "doTestFoldIfToReturnAsymmetrically"),
|
||||
testModel("idea/testData/intentions/branched/folding/whenToAssignment", "doTestFoldWhenToAssignment"),
|
||||
testModel("idea/testData/intentions/branched/folding/whenToReturn", "doTestFoldWhenToReturn"),
|
||||
testModel("idea/testData/intentions/branched/unfolding/assignmentToIf", "doTestUnfoldAssignmentToIf"),
|
||||
testModel("idea/testData/intentions/branched/unfolding/assignmentToWhen", "doTestUnfoldAssignmentToWhen"),
|
||||
testModel("idea/testData/intentions/branched/unfolding/propertyToIf", "doTestUnfoldPropertyToIf"),
|
||||
testModel("idea/testData/intentions/branched/unfolding/propertyToWhen", "doTestUnfoldPropertyToWhen"),
|
||||
testModel("idea/testData/intentions/branched/unfolding/returnToIf", "doTestUnfoldReturnToIf"),
|
||||
testModel("idea/testData/intentions/branched/unfolding/returnToWhen", "doTestUnfoldReturnToWhen"),
|
||||
testModel("idea/testData/intentions/branched/ifWhen/ifToWhen", "doTestIfToWhen"),
|
||||
testModel("idea/testData/intentions/branched/ifWhen/whenToIf", "doTestWhenToIf"),
|
||||
testModel("idea/testData/intentions/branched/when/flatten", "doTestFlattenWhen"),
|
||||
testModel("idea/testData/intentions/branched/when/introduceSubject", "doTestIntroduceWhenSubject"),
|
||||
testModel("idea/testData/intentions/branched/when/eliminateSubject", "doTestEliminateWhenSubject"),
|
||||
testModel("idea/testData/intentions/declarations/split", "doTestSplitProperty"),
|
||||
testModel("idea/testData/intentions/declarations/join", "doTestJoinProperty"),
|
||||
testModel("idea/testData/intentions/removeUnnecessaryParentheses", "doTestRemoveUnnecessaryParentheses")
|
||||
);
|
||||
|
||||
generateTest(
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<implementation-class>org.jetbrains.jet.plugin.versions.OutdatedKotlinRuntimeNotification</implementation-class>
|
||||
</component>
|
||||
<component>
|
||||
<implementation-class>org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureInJavaMarkerUpdater</implementation-class>
|
||||
<implementation-class>org.jetbrains.jet.plugin.ktSignature.KotlinSignatureInJavaMarkerUpdater</implementation-class>
|
||||
</component>
|
||||
</project-components>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</action>
|
||||
|
||||
<group id="EditorGutterKotlinPopupMenu">
|
||||
<action id="ShowKotlinSignatures" class="org.jetbrains.jet.plugin.codeInsight.ktSignature.ShowKotlinSignaturesAction"/>
|
||||
<action id="ShowKotlinSignatures" class="org.jetbrains.jet.plugin.ktSignature.ShowKotlinSignaturesAction"/>
|
||||
<add-to-group group-id="EditorGutterPopupMenu" anchor="last"/>
|
||||
</group>
|
||||
</actions>
|
||||
@@ -211,7 +211,7 @@
|
||||
<configurationProducer implementation="org.jetbrains.jet.plugin.run.JetJUnitConfigurationProducer"/>
|
||||
<codeInsight.lineMarkerProvider language="jet" implementationClass="org.jetbrains.jet.plugin.highlighter.JetLineMarkerProvider"/>
|
||||
<codeInsight.lineMarkerProvider language="JAVA"
|
||||
implementationClass="org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureInJavaMarkerProvider"/>
|
||||
implementationClass="org.jetbrains.jet.plugin.ktSignature.KotlinSignatureInJavaMarkerProvider"/>
|
||||
<iconProvider implementation="org.jetbrains.jet.plugin.JetIconProvider"/>
|
||||
<itemPresentationProvider implementationClass="org.jetbrains.jet.plugin.presentation.JetFunctionPresenter"
|
||||
forClass="org.jetbrains.jet.lang.psi.JetNamedFunction"/>
|
||||
@@ -291,7 +291,7 @@
|
||||
implementation="org.jetbrains.jet.plugin.codeInsight.upDownMover.JetDeclarationMover"
|
||||
order="before jetExpression" />
|
||||
|
||||
<joinLinesHandler implementation="org.jetbrains.jet.plugin.codeInsight.codeTransformations.declarations.JetDeclarationJoinLinesHandler"/>
|
||||
<joinLinesHandler implementation="org.jetbrains.jet.plugin.intentions.declarations.JetDeclarationJoinLinesHandler"/>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction</className>
|
||||
@@ -299,97 +299,97 @@
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureAnnotationIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.ktSignature.KotlinSignatureAnnotationIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldIfToAssignmentIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldIfToAssignmentIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldIfToReturnAsymmetricallyIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldIfToReturnAsymmetricallyIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldIfToReturnIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldIfToReturnIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldWhenToAssignmentIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldWhenToAssignmentIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldWhenToReturnIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldBranchedExpressionIntention$FoldWhenToReturnIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldAssignmentToIfIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldAssignmentToIfIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldPropertyToIfIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldPropertyToIfIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldAssignmentToWhenIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldAssignmentToWhenIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldPropertyToWhenIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldPropertyToWhenIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldReturnToIfIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldReturnToIfIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldReturnToWhenIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldBranchedExpressionIntention$UnfoldReturnToWhenIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.IfToWhenIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfToWhenIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.WhenToIfIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.WhenToIfIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.FlattenWhenIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FlattenWhenIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.IntroduceWhenSubjectIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IntroduceWhenSubjectIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions.EliminateWhenSubjectIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.EliminateWhenSubjectIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.RemoveUnnecessaryParenthesesIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.RemoveUnnecessaryParenthesesIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.jet.plugin.codeInsight.codeTransformations.declarations.SplitPropertyDeclarationIntention</className>
|
||||
<className>org.jetbrains.jet.plugin.intentions.declarations.SplitPropertyDeclarationIntention</className>
|
||||
<category>Kotlin</category>
|
||||
</intentionAction>
|
||||
|
||||
|
||||
+1
-2
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
|
||||
@@ -29,7 +29,6 @@ import org.jetbrains.jet.lang.psi.JetElement;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.plugin.JetBundle;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
|
||||
public abstract class AbstractCodeTransformationIntention<T extends Transformer> extends BaseIntentionAction {
|
||||
private final T transformer;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions;
|
||||
|
||||
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.project.Project;
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.declarations.DeclarationUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.declarations.DeclarationUtils;
|
||||
|
||||
public class BranchedUnfoldingUtils {
|
||||
private BranchedUnfoldingUtils() {
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetIfExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetWhenExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public enum FoldableKind implements Transformer {
|
||||
IF_TO_ASSIGNMENT("fold.if.to.assignment") {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.jet.lang.psi.JetBinaryExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
||||
import org.jetbrains.jet.lang.psi.JetReturnExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public enum UnfoldableKind implements Transformer {
|
||||
ASSIGNMENT_TO_IF("unfold.assignment.to.if") {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations;
|
||||
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -7,9 +7,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetWhenExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.WhenUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.WhenUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public class EliminateWhenSubjectIntention extends AbstractCodeTransformationIntention<Transformer> {
|
||||
private static final Transformer TRANSFORMER = new Transformer() {
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -7,9 +7,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetWhenExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.WhenUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.WhenUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public class FlattenWhenIntention extends AbstractCodeTransformationIntention<Transformer> {
|
||||
private static final Transformer TRANSFORMER = new Transformer() {
|
||||
+4
-4
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.BranchedFoldingUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.FoldableKind;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.BranchedFoldingUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.FoldableKind;
|
||||
|
||||
public abstract class FoldBranchedExpressionIntention extends AbstractCodeTransformationIntention<FoldableKind> {
|
||||
protected FoldBranchedExpressionIntention(@NotNull final FoldableKind foldableKind) {
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -7,9 +7,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetIfExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.IfWhenUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.IfWhenUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public class IfToWhenIntention extends AbstractCodeTransformationIntention<Transformer> {
|
||||
private static final Transformer TRANSFORMER = new Transformer() {
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -7,9 +7,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetWhenExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.WhenUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.WhenUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public class IntroduceWhenSubjectIntention extends AbstractCodeTransformationIntention<Transformer> {
|
||||
private static final Transformer TRANSFORMER = new Transformer() {
|
||||
+3
-3
@@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.*;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.*;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
|
||||
public abstract class UnfoldBranchedExpressionIntention extends AbstractCodeTransformationIntention<UnfoldableKind> {
|
||||
protected UnfoldBranchedExpressionIntention(@NotNull final UnfoldableKind unfoldableKind) {
|
||||
+4
-4
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.intentions;
|
||||
package org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -23,9 +23,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetWhenExpression;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransformations.IfWhenUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.branchedTransformations.IfWhenUtils;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public class WhenToIfIntention extends AbstractCodeTransformationIntention<Transformer> {
|
||||
private static final Transformer TRANSFORMER = new Transformer() {
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.declarations;
|
||||
package org.jetbrains.jet.plugin.intentions.declarations;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.project.Project;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.declarations;
|
||||
package org.jetbrains.jet.plugin.intentions.declarations;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.codeInsight.editorActions.JoinRawLinesHandlerDelegate;
|
||||
+3
-3
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.codeTransformations.declarations;
|
||||
package org.jetbrains.jet.plugin.intentions.declarations;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -23,8 +23,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.codeInsight.codeTransformations.Transformer;
|
||||
import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationIntention;
|
||||
import org.jetbrains.jet.plugin.intentions.Transformer;
|
||||
|
||||
public class SplitPropertyDeclarationIntention extends AbstractCodeTransformationIntention<Transformer> {
|
||||
private static final Transformer TRANSFORMER = new Transformer() {
|
||||
+6
-8
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeInsight.ExternalAnnotationsManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -26,15 +26,13 @@ import com.intellij.psi.PsiAnnotation;
|
||||
import com.intellij.psi.PsiModifierListOwner;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureUtil.*;
|
||||
|
||||
public class DeleteSignatureAction extends AnAction {
|
||||
private final PsiModifierListOwner annotationOwner;
|
||||
|
||||
public DeleteSignatureAction(@NotNull PsiModifierListOwner elementInEditor) {
|
||||
super("Delete");
|
||||
this.annotationOwner = getAnnotationOwner(elementInEditor);
|
||||
getTemplatePresentation().setVisible(isAnnotationEditable(elementInEditor));
|
||||
this.annotationOwner = KotlinSignatureUtil.getAnnotationOwner(elementInEditor);
|
||||
getTemplatePresentation().setVisible(KotlinSignatureUtil.isAnnotationEditable(elementInEditor));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,7 +40,7 @@ public class DeleteSignatureAction extends AnAction {
|
||||
final Project project = e.getProject();
|
||||
assert project != null;
|
||||
|
||||
final PsiAnnotation annotation = findKotlinSignatureAnnotation(annotationOwner);
|
||||
final PsiAnnotation annotation = KotlinSignatureUtil.findKotlinSignatureAnnotation(annotationOwner);
|
||||
assert annotation != null;
|
||||
|
||||
if (annotation.getContainingFile() != annotationOwner.getContainingFile()) {
|
||||
@@ -50,7 +48,7 @@ public class DeleteSignatureAction extends AnAction {
|
||||
new WriteCommandAction(project) {
|
||||
@Override
|
||||
protected void run(Result result) throws Throwable {
|
||||
ExternalAnnotationsManager.getInstance(project).deannotate(annotationOwner, KOTLIN_SIGNATURE_ANNOTATION);
|
||||
ExternalAnnotationsManager.getInstance(project).deannotate(annotationOwner, KotlinSignatureUtil.KOTLIN_SIGNATURE_ANNOTATION);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
@@ -64,6 +62,6 @@ public class DeleteSignatureAction extends AnAction {
|
||||
}
|
||||
|
||||
|
||||
refreshMarkers(project);
|
||||
KotlinSignatureUtil.refreshMarkers(project);
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeInsight.navigation.NavigationUtil;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -30,13 +30,11 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import static org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureUtil.*;
|
||||
|
||||
public class EditSignatureAction extends AnAction {
|
||||
private final PsiModifierListOwner elementInEditor;
|
||||
|
||||
public EditSignatureAction(@NotNull PsiModifierListOwner elementInEditor) {
|
||||
super(isAnnotationEditable(elementInEditor) ? "Edit" : "View");
|
||||
super(KotlinSignatureUtil.isAnnotationEditable(elementInEditor) ? "Edit" : "View");
|
||||
this.elementInEditor = elementInEditor;
|
||||
}
|
||||
|
||||
@@ -52,7 +50,7 @@ public class EditSignatureAction extends AnAction {
|
||||
}
|
||||
|
||||
static void invokeEditSignature(@NotNull PsiElement elementInEditor, @NotNull Editor editor, @Nullable Point point) {
|
||||
PsiAnnotation annotation = findKotlinSignatureAnnotation(elementInEditor);
|
||||
PsiAnnotation annotation = KotlinSignatureUtil.findKotlinSignatureAnnotation(elementInEditor);
|
||||
assert annotation != null;
|
||||
if (annotation.getContainingFile() == elementInEditor.getContainingFile()) {
|
||||
// not external, go to
|
||||
@@ -75,9 +73,9 @@ public class EditSignatureAction extends AnAction {
|
||||
}
|
||||
}
|
||||
else {
|
||||
PsiModifierListOwner annotationOwner = getAnnotationOwner(elementInEditor);
|
||||
boolean editable = isAnnotationEditable(elementInEditor);
|
||||
EditSignatureBalloon balloon = new EditSignatureBalloon(annotationOwner, getKotlinSignature(annotation), editable);
|
||||
PsiModifierListOwner annotationOwner = KotlinSignatureUtil.getAnnotationOwner(elementInEditor);
|
||||
boolean editable = KotlinSignatureUtil.isAnnotationEditable(elementInEditor);
|
||||
EditSignatureBalloon balloon = new EditSignatureBalloon(annotationOwner, KotlinSignatureUtil.getKotlinSignature(annotation), editable);
|
||||
balloon.show(point, editor, elementInEditor);
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeInsight.ExternalAnnotationsManager;
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -54,9 +54,6 @@ import java.awt.event.ActionListener;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
import static org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureUtil.KOTLIN_SIGNATURE_ANNOTATION;
|
||||
import static org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureUtil.signatureToNameValuePairs;
|
||||
|
||||
class EditSignatureBalloon implements Disposable {
|
||||
private final Editor editor;
|
||||
private final PsiModifierListOwner annotatedElement;
|
||||
@@ -179,7 +176,8 @@ class EditSignatureBalloon implements Disposable {
|
||||
@Override
|
||||
protected void run(Result result) throws Throwable {
|
||||
ExternalAnnotationsManager.getInstance(project).editExternalAnnotation(
|
||||
annotatedElement, KOTLIN_SIGNATURE_ANNOTATION, signatureToNameValuePairs(project, newSignature));
|
||||
annotatedElement, KotlinSignatureUtil.KOTLIN_SIGNATURE_ANNOTATION, KotlinSignatureUtil
|
||||
.signatureToNameValuePairs(project, newSignature));
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
+8
-9
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeInsight.ExternalAnnotationsListener;
|
||||
import com.intellij.codeInsight.ExternalAnnotationsManager;
|
||||
@@ -47,8 +47,6 @@ import org.jetbrains.jet.renderer.DescriptorRendererBuilder;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import static org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureUtil.*;
|
||||
|
||||
public class KotlinSignatureAnnotationIntention extends BaseIntentionAction implements Iconable {
|
||||
private static final DescriptorRenderer RENDERER = new DescriptorRendererBuilder()
|
||||
.setShortNames(true)
|
||||
@@ -80,8 +78,8 @@ public class KotlinSignatureAnnotationIntention extends BaseIntentionAction impl
|
||||
|
||||
if (!PsiUtil.isLanguageLevel5OrHigher(annotationOwner)) return false;
|
||||
|
||||
if (findKotlinSignatureAnnotation(annotationOwner) != null) {
|
||||
if (isAnnotationEditable(annotationOwner)) {
|
||||
if (KotlinSignatureUtil.findKotlinSignatureAnnotation(annotationOwner) != null) {
|
||||
if (KotlinSignatureUtil.isAnnotationEditable(annotationOwner)) {
|
||||
setText(JetBundle.message("edit.kotlin.signature.action.text"));
|
||||
}
|
||||
else {
|
||||
@@ -100,7 +98,7 @@ public class KotlinSignatureAnnotationIntention extends BaseIntentionAction impl
|
||||
|
||||
assert annotatedElement != null;
|
||||
|
||||
if (findKotlinSignatureAnnotation(annotatedElement) != null) {
|
||||
if (KotlinSignatureUtil.findKotlinSignatureAnnotation(annotatedElement) != null) {
|
||||
EditSignatureAction.invokeEditSignature(annotatedElement, editor, null);
|
||||
return;
|
||||
}
|
||||
@@ -113,11 +111,11 @@ public class KotlinSignatureAnnotationIntention extends BaseIntentionAction impl
|
||||
public void afterExternalAnnotationChanging(@NotNull PsiModifierListOwner owner, @NotNull String annotationFQName, boolean successful) {
|
||||
busConnection.disconnect();
|
||||
|
||||
if (successful && owner == annotatedElement && KOTLIN_SIGNATURE_ANNOTATION.equals(annotationFQName)) {
|
||||
if (successful && owner == annotatedElement && KotlinSignatureUtil.KOTLIN_SIGNATURE_ANNOTATION.equals(annotationFQName)) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshMarkers(project);
|
||||
KotlinSignatureUtil.refreshMarkers(project);
|
||||
EditSignatureAction.invokeEditSignature(annotatedElement, editor, null);
|
||||
}
|
||||
}, ModalityState.NON_MODAL);
|
||||
@@ -126,7 +124,8 @@ public class KotlinSignatureAnnotationIntention extends BaseIntentionAction impl
|
||||
});
|
||||
|
||||
AddAnnotationFix addAnnotationFix = new AddAnnotationFix(
|
||||
KOTLIN_SIGNATURE_ANNOTATION, annotatedElement, signatureToNameValuePairs(annotatedElement.getProject(), signature));
|
||||
KotlinSignatureUtil.KOTLIN_SIGNATURE_ANNOTATION, annotatedElement, KotlinSignatureUtil
|
||||
.signatureToNameValuePairs(annotatedElement.getProject(), signature));
|
||||
addAnnotationFix.invoke(project, editor, file);
|
||||
}
|
||||
|
||||
+6
-8
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeHighlighting.Pass;
|
||||
import com.intellij.codeInsight.daemon.GutterIconNavigationHandler;
|
||||
@@ -53,8 +53,6 @@ import java.awt.event.MouseEvent;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.plugin.codeInsight.ktSignature.KotlinSignatureUtil.*;
|
||||
|
||||
public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
|
||||
private static final String SHOW_MARKERS_PROPERTY = "kotlin.signature.markers.enabled";
|
||||
|
||||
@@ -104,7 +102,7 @@ public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
|
||||
if (memberDescriptor == null) continue;
|
||||
|
||||
List<String> errors = trace.get(BindingContext.LOAD_FROM_JAVA_SIGNATURE_ERRORS, memberDescriptor);
|
||||
boolean hasSignatureAnnotation = findKotlinSignatureAnnotation(element) != null;
|
||||
boolean hasSignatureAnnotation = KotlinSignatureUtil.findKotlinSignatureAnnotation(element) != null;
|
||||
|
||||
if (errors != null || hasSignatureAnnotation) {
|
||||
result.add(new MyLineMarkerInfo((PsiModifierListOwner) element, errors, hasSignatureAnnotation));
|
||||
@@ -200,7 +198,7 @@ public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
|
||||
memberScope.getProperties(name);
|
||||
}
|
||||
|
||||
PsiModifierListOwner annotationOwner = getAnnotationOwner(member);
|
||||
PsiModifierListOwner annotationOwner = KotlinSignatureUtil.getAnnotationOwner(member);
|
||||
return trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, annotationOwner);
|
||||
}
|
||||
|
||||
@@ -210,7 +208,7 @@ public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
|
||||
|
||||
public static void setMarkersEnabled(@NotNull Project project, boolean value) {
|
||||
PropertiesComponent.getInstance(project).setValue(SHOW_MARKERS_PROPERTY, Boolean.toString(value));
|
||||
refreshMarkers(project);
|
||||
KotlinSignatureUtil.refreshMarkers(project);
|
||||
}
|
||||
|
||||
private static class MyLineMarkerInfo extends LineMarkerInfo<PsiModifierListOwner> {
|
||||
@@ -245,11 +243,11 @@ public class KotlinSignatureInJavaMarkerProvider implements LineMarkerProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public String fun(PsiElement element) {
|
||||
PsiAnnotation annotation = findKotlinSignatureAnnotation(element);
|
||||
PsiAnnotation annotation = KotlinSignatureUtil.findKotlinSignatureAnnotation(element);
|
||||
|
||||
if (annotation == null) return errorsString();
|
||||
|
||||
String signature = getKotlinSignature(annotation);
|
||||
String signature = KotlinSignatureUtil.getKotlinSignature(annotation);
|
||||
String text = "Alternative Kotlin signature is available for this method:\n"
|
||||
+ StringUtil.escapeXml(signature);
|
||||
if (errors == null) {
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeInsight.ExternalAnnotationsListener;
|
||||
import com.intellij.codeInsight.ExternalAnnotationsManager;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.codeInsight.ExternalAnnotationsManager;
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.plugin.codeInsight.ktSignature;
|
||||
package org.jetbrains.jet.plugin.ktSignature;
|
||||
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user