rename
This commit is contained in:
committed by
Andrey Breslav
parent
115bd21bea
commit
3e5026407d
@@ -67,7 +67,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
if (parent instanceof JetProperty) {
|
||||
JetProperty property = (JetProperty) parent;
|
||||
if (property.getPropertyTypeRef() == null) {
|
||||
if (property.getTypeRef() == null) {
|
||||
addTypeAnnotation(project, property, type);
|
||||
}
|
||||
else {
|
||||
@@ -105,7 +105,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
JetNamedDeclaration declaration = (JetNamedDeclaration) parent;
|
||||
if (declaration instanceof JetProperty && !PsiTreeUtil.isAncestor(((JetProperty) declaration).getInitializer(), element, false)) {
|
||||
if (((JetProperty) declaration).getPropertyTypeRef() != null) {
|
||||
if (((JetProperty) declaration).getTypeRef() != null) {
|
||||
setText(JetBundle.message("specify.type.explicitly.remove.action.name"));
|
||||
return true;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
public static void addTypeAnnotation(Project project, JetProperty property, @NotNull JetType exprType) {
|
||||
if (property.getPropertyTypeRef() != null) return;
|
||||
if (property.getTypeRef() != null) return;
|
||||
PsiElement anchor = property.getNameIdentifier();
|
||||
if (anchor == null) return;
|
||||
anchor = anchor.getNextSibling();
|
||||
@@ -227,7 +227,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
public static void removeTypeAnnotation(JetProperty property) {
|
||||
removeTypeAnnotation(property, property.getPropertyTypeRef());
|
||||
removeTypeAnnotation(property, property.getTypeRef());
|
||||
}
|
||||
|
||||
public static void removeTypeAnnotation(JetParameter parameter) {
|
||||
|
||||
@@ -22,15 +22,9 @@ import com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode;
|
||||
import com.intellij.ide.util.treeView.AbstractTreeNode;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.codeStyle.CodeStyleManager;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.plugin.formatter.JetCodeStyleSettings;
|
||||
import org.jetbrains.jet.plugin.project.WholeProjectAnalyzerFacade;
|
||||
import org.jetbrains.jet.plugin.structureView.JetStructureViewElement;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -69,7 +63,7 @@ public class JetDeclarationTreeNode extends AbstractPsiBasedNode<JetDeclaration>
|
||||
text = CLASS_INITIALIZER;
|
||||
} else if (declaration instanceof JetProperty) {
|
||||
JetProperty property = (JetProperty) declaration;
|
||||
JetTypeReference ref = property.getPropertyTypeRef();
|
||||
JetTypeReference ref = property.getTypeRef();
|
||||
if (ref != null) {
|
||||
if (settings.SPACE_BEFORE_TYPE_COLON) text += " ";
|
||||
text += ":";
|
||||
|
||||
@@ -114,7 +114,7 @@ public class RemovePartsFromPropertyFix extends JetIntentionAction<JetProperty>
|
||||
assert nextSibling != null;
|
||||
newElement.deleteChildRange(nextSibling, initializer);
|
||||
|
||||
if (newElement.getPropertyTypeRef() == null && type != null) {
|
||||
if (newElement.getTypeRef() == null && type != null) {
|
||||
typeToAdd = type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user