mark last parenthesis instead of value argument list
This commit is contained in:
@@ -352,7 +352,7 @@ public interface Errors {
|
||||
|
||||
AmbiguousDescriptorDiagnosticFactory OVERLOAD_RESOLUTION_AMBIGUITY = new AmbiguousDescriptorDiagnosticFactory();
|
||||
AmbiguousDescriptorDiagnosticFactory NONE_APPLICABLE = new AmbiguousDescriptorDiagnosticFactory();
|
||||
DiagnosticFactory1<PsiElement, ValueParameterDescriptor> NO_VALUE_FOR_PARAMETER = DiagnosticFactory1.create(ERROR);
|
||||
DiagnosticFactory1<JetElement, ValueParameterDescriptor> NO_VALUE_FOR_PARAMETER = DiagnosticFactory1.create(ERROR, VALUE_ARGUMENTS);
|
||||
DiagnosticFactory1<JetReferenceExpression, JetType> MISSING_RECEIVER = DiagnosticFactory1.create(ERROR);
|
||||
SimpleDiagnosticFactory<JetReferenceExpression> NO_RECEIVER_ADMITTED = SimpleDiagnosticFactory.create(ERROR);
|
||||
|
||||
|
||||
@@ -322,4 +322,19 @@ public class PositioningStrategies {
|
||||
return super.mark(element);
|
||||
}
|
||||
};
|
||||
|
||||
public static PositioningStrategy<JetElement> VALUE_ARGUMENTS = new PositioningStrategy<JetElement>() {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<TextRange> mark(@NotNull JetElement element) {
|
||||
if (element instanceof JetValueArgumentList) {
|
||||
PsiElement rightParenthesis = ((JetValueArgumentList) element).getRightParenthesis();
|
||||
if (rightParenthesis != null) {
|
||||
return markElement(rightParenthesis);
|
||||
}
|
||||
|
||||
}
|
||||
return super.mark(element);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -17,8 +17,11 @@
|
||||
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.JetNodeTypes;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -43,4 +46,10 @@ public class JetValueArgumentList extends JetElementImpl {
|
||||
public List<JetValueArgument> getArguments() {
|
||||
return findChildrenByType(JetNodeTypes.VALUE_ARGUMENT);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PsiElement getRightParenthesis() {
|
||||
return findChildByType(JetTokens.RPAR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class ResolutionTask<D extends CallableDescriptor, F extends D> extends R
|
||||
|
||||
@Override
|
||||
public void noValueForParameter(@NotNull BindingTrace trace, @NotNull ValueParameterDescriptor valueParameter) {
|
||||
PsiElement reportOn;
|
||||
JetElement reportOn;
|
||||
JetValueArgumentList valueArgumentList = call.getValueArgumentList();
|
||||
if (valueArgumentList != null) {
|
||||
reportOn = valueArgumentList;
|
||||
|
||||
Reference in New Issue
Block a user