Don't suggest non-stable parameter names in completion

This commit is contained in:
Alexander Udalov
2014-03-20 12:02:05 +04:00
parent b33e3fc9d6
commit 1c25723764
4 changed files with 18 additions and 0 deletions
@@ -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");