Change Signature: Do not fail on dynamic calls. Show error messages instead
#KT-6529 Fixed
This commit is contained in:
+16
-1
@@ -41,9 +41,11 @@ import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.calls.tasks.TasksPackage;
|
||||
import org.jetbrains.jet.lang.resolve.java.descriptor.JavaCallableMemberDescriptor;
|
||||
import org.jetbrains.jet.plugin.codeInsight.DescriptorToDeclarationUtil;
|
||||
import org.jetbrains.jet.plugin.caches.resolve.ResolvePackage;
|
||||
import org.jetbrains.jet.plugin.codeInsight.CodeInsightUtils;
|
||||
import org.jetbrains.jet.plugin.codeInsight.DescriptorToDeclarationUtil;
|
||||
import org.jetbrains.jet.plugin.refactoring.JetRefactoringBundle;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -114,6 +116,19 @@ public class JetChangeSignatureHandler implements ChangeSignatureHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (TasksPackage.isDynamic(functionDescriptor)) {
|
||||
if (editor != null) {
|
||||
CodeInsightUtils.showErrorHint(
|
||||
project,
|
||||
editor,
|
||||
"Change signature is not applicable to dynamically invoked functions",
|
||||
"Change Signature",
|
||||
null
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
runChangeSignature(project, functionDescriptor, emptyConfiguration(), bindingContext, context, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user