Ctrl-Q and other PsiElement-based features to work for synthetic java properties

#KT-11676 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-04-01 17:38:56 +03:00
parent 2aba11abb8
commit e7fa0bec9a
@@ -140,7 +140,11 @@ class BasicLookupElementFactory(
}
val name = nameAndIconDescriptor.name.asString()
val lookupObject = object : DeclarationLookupObjectImpl(descriptor, declaration) {
val psiElement = declaration
?: (descriptor as? SyntheticJavaPropertyDescriptor)
?.getMethod
?.let { DescriptorToSourceUtilsIde.getAnyDeclaration(project, it) }
val lookupObject = object : DeclarationLookupObjectImpl(descriptor, psiElement) {
override fun getIcon(flags: Int) = KotlinDescriptorIconProvider.getIcon(nameAndIconDescriptor, iconDeclaration, flags)
}
var element = LookupElementBuilder.create(lookupObject, name)