Don't suggest non-stable parameter names in completion
This commit is contained in:
@@ -88,6 +88,8 @@ public class KotlinNamedParametersContributor : CompletionContributor() {
|
||||
val functionDescriptors = callReference.resolveToDescriptors().map { it as? FunctionDescriptor }.filterNotNull()
|
||||
|
||||
for (funDescriptor in functionDescriptors) {
|
||||
if (!funDescriptor.hasStableParameterNames()) continue
|
||||
|
||||
val usedArguments = QuickFixUtil.getUsedParameters(callElement, valueArgument, funDescriptor)
|
||||
|
||||
for (parameter in funDescriptor.getValueParameters()) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import lib.JavaClass
|
||||
|
||||
fun test() = JavaClass().foo(<caret>)
|
||||
|
||||
// ABSENT: p0
|
||||
// ABSENT: paramName
|
||||
@@ -0,0 +1,5 @@
|
||||
package lib;
|
||||
|
||||
public class JavaClass {
|
||||
public void foo(int paramName) {}
|
||||
}
|
||||
@@ -36,6 +36,11 @@ public class JvmWithLibBasicCompletionTestGenerated extends AbstractJvmWithLibBa
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/completion/basic/custom"), Pattern.compile("^(.+)\\.kt$"), false);
|
||||
}
|
||||
|
||||
@TestMetadata("JavaMethodNamedArguments.kt")
|
||||
public void testJavaMethodNamedArguments() throws Exception {
|
||||
doTest("idea/testData/completion/basic/custom/JavaMethodNamedArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("TopLevelNonImportedExtFun.kt")
|
||||
public void testTopLevelNonImportedExtFun() throws Exception {
|
||||
doTest("idea/testData/completion/basic/custom/TopLevelNonImportedExtFun.kt");
|
||||
|
||||
Reference in New Issue
Block a user