Make call return JetElement instead of PsiElement
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue;
|
||||
@@ -55,7 +54,7 @@ public interface Call {
|
||||
JetTypeArgumentList getTypeArgumentList();
|
||||
|
||||
@NotNull
|
||||
PsiElement getCallElement();
|
||||
JetElement getCallElement();
|
||||
|
||||
enum CallType {
|
||||
DEFAULT, ARRAY_GET_METHOD, ARRAY_SET_METHOD, INVOKE
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface JetCallElement extends PsiElement {
|
||||
public interface JetCallElement extends JetElement {
|
||||
@Nullable
|
||||
JetExpression getCalleeExpression();
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.jetbrains.jet.lang.resolve.calls;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
@@ -258,7 +257,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiElement getCallElement() {
|
||||
public JetElement getCallElement() {
|
||||
return outerCall.getCallElement();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ import com.intellij.psi.impl.source.tree.LeafPsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ExpressionReceiver;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue;
|
||||
import org.jetbrains.jet.lang.psi.Call.CallType;
|
||||
|
||||
@@ -73,18 +71,18 @@ public class CallMaker {
|
||||
|
||||
private static class CallImpl implements Call {
|
||||
|
||||
private final PsiElement callElement;
|
||||
private final JetElement callElement;
|
||||
private final ReceiverValue explicitReceiver;
|
||||
private final ASTNode callOperationNode;
|
||||
private final JetExpression calleeExpression;
|
||||
private final List<? extends ValueArgument> valueArguments;
|
||||
private final Call.CallType callType;
|
||||
|
||||
protected CallImpl(@NotNull PsiElement callElement, @NotNull ReceiverValue explicitReceiver, @Nullable ASTNode callOperationNode, @Nullable JetExpression calleeExpression, @NotNull List<? extends ValueArgument> valueArguments) {
|
||||
protected CallImpl(@NotNull JetElement callElement, @NotNull ReceiverValue explicitReceiver, @Nullable ASTNode callOperationNode, @Nullable JetExpression calleeExpression, @NotNull List<? extends ValueArgument> valueArguments) {
|
||||
this(callElement, explicitReceiver, callOperationNode, calleeExpression, valueArguments, CallType.DEFAULT);
|
||||
}
|
||||
|
||||
protected CallImpl(@NotNull PsiElement callElement, @NotNull ReceiverValue explicitReceiver, @Nullable ASTNode callOperationNode,
|
||||
protected CallImpl(@NotNull JetElement callElement, @NotNull ReceiverValue explicitReceiver, @Nullable ASTNode callOperationNode,
|
||||
@Nullable JetExpression calleeExpression, @NotNull List<? extends ValueArgument> valueArguments, @NotNull CallType callType) {
|
||||
this.callElement = callElement;
|
||||
this.explicitReceiver = explicitReceiver;
|
||||
@@ -124,7 +122,7 @@ public class CallMaker {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiElement getCallElement() {
|
||||
public JetElement getCallElement() {
|
||||
return callElement;
|
||||
}
|
||||
|
||||
@@ -287,7 +285,7 @@ public class CallMaker {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiElement getCallElement() {
|
||||
public JetElement getCallElement() {
|
||||
return callElement;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.lang.resolve.calls.util;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
@@ -89,7 +88,7 @@ public class DelegatingCall implements Call {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiElement getCallElement() {
|
||||
public JetElement getCallElement() {
|
||||
return delegate.getCallElement();
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@ package org.jetbrains.jet.lang.types.expressions;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
@@ -227,7 +226,7 @@ public class ControlStructureTypingUtils {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiElement getCallElement() {
|
||||
public JetElement getCallElement() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user