Smart completion: fixed items ordering issue
This commit is contained in:
@@ -41,8 +41,7 @@ class StaticMembers(val bindingContext: BindingContext, val resolveSession: Reso
|
||||
context: JetExpression,
|
||||
enumEntriesToSkip: Set<DeclarationDescriptor>) {
|
||||
|
||||
val scope = bindingContext[BindingContext.RESOLUTION_SCOPE, context]
|
||||
if (scope == null) return
|
||||
val scope = bindingContext[BindingContext.RESOLUTION_SCOPE, context] ?: return
|
||||
|
||||
val expectedInfosByClass = expectedInfos.groupBy { TypeUtils.getClassDescriptor(it.type) }
|
||||
for ((classDescriptor, expectedInfosForClass) in expectedInfosByClass) {
|
||||
@@ -64,8 +63,7 @@ class StaticMembers(val bindingContext: BindingContext, val resolveSession: Reso
|
||||
|
||||
val classifier: (ExpectedInfo) -> ExpectedInfoClassification
|
||||
if (descriptor is CallableDescriptor) {
|
||||
val returnType = descriptor.getReturnType()
|
||||
if (returnType == null) return
|
||||
val returnType = descriptor.getReturnType() ?: return
|
||||
classifier = {
|
||||
expectedInfo ->
|
||||
when {
|
||||
@@ -109,12 +107,9 @@ class StaticMembers(val bindingContext: BindingContext, val resolveSession: Reso
|
||||
private fun createLookupElement(memberDescriptor: DeclarationDescriptor, classDescriptor: ClassDescriptor): LookupElement {
|
||||
val lookupElement = createLookupElement(memberDescriptor, resolveSession, bindingContext)
|
||||
val qualifierPresentation = classDescriptor.getName().asString()
|
||||
val lookupString = qualifierPresentation + "." + lookupElement.getLookupString()
|
||||
val qualifierText = qualifiedNameForSourceCode(classDescriptor)
|
||||
|
||||
return object: LookupElementDecorator<LookupElement>(lookupElement) {
|
||||
override fun getLookupString() = lookupString
|
||||
|
||||
override fun renderElement(presentation: LookupElementPresentation) {
|
||||
getDelegate().renderElement(presentation)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user