KT-9166 Code completion does not work for synthetic extensions on typing "g"
#KT-9166 Fixed
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.io.File
|
||||
|
||||
fun foo(file: File) {
|
||||
file.g<caret>
|
||||
}
|
||||
|
||||
// EXIST: absolutePath
|
||||
// ABSENT: getAbsolutePath
|
||||
+6
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user