KT-9166 Code completion does not work for synthetic extensions on typing "g"

#KT-9166 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-05-12 23:13:33 +03:00
parent e04c6d1f5c
commit e8d518a28f
3 changed files with 15 additions and 1 deletions
@@ -118,7 +118,7 @@ abstract class CompletionSession(
protected val descriptorNameFilter: (Name) -> Boolean = run {
val nameFilter = prefixMatcher.asNameFilter()
val getOrSetPrefix = listOf("get", "set").firstOrNull { prefix.startsWith(it) }
val getOrSetPrefix = listOf("get", "set", "ge", "se", "g", "s").firstOrNull { prefix.startsWith(it) }
if (getOrSetPrefix != null)
nameFilter or prefixMatcher.cloneWithPrefix(prefix.removePrefix(getOrSetPrefix).decapitalizeSmart()).asNameFilter()
else
+8
View File
@@ -0,0 +1,8 @@
import java.io.File
fun foo(file: File) {
file.g<caret>
}
// EXIST: absolutePath
// ABSENT: getAbsolutePath
@@ -2647,6 +2647,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
doTest(fileName);
}
@TestMetadata("KT9166.kt")
public void testKT9166() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/KT9166.kt");
doTest(fileName);
}
@TestMetadata("NoDuplicationForImportedJavaClass.kt")
public void testNoDuplicationForImportedJavaClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/NoDuplicationForImportedJavaClass.kt");