@NotNull
 public static LookupElement createLookupElement(
     @NotNull KotlinCodeAnalyzer analyzer,
     @NotNull BindingContext bindingContext,
     @NotNull DeclarationDescriptor descriptor) {
   if (descriptor instanceof CallableMemberDescriptor) {
     CallableMemberDescriptor callableMemberDescriptor = (CallableMemberDescriptor) descriptor;
     while (callableMemberDescriptor.getKind() == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
       // TODO: need to know all of them
       callableMemberDescriptor =
           callableMemberDescriptor.getOverriddenDescriptors().iterator().next();
     }
     descriptor = callableMemberDescriptor;
   }
   return createLookupElement(
       analyzer,
       descriptor,
       BindingContextUtils.descriptorToDeclaration(bindingContext, descriptor));
 }
示例#2
0
 private void renderMemberKind(CallableMemberDescriptor callableMember, StringBuilder builder) {
   if (!modifiers.contains(Modifier.MEMBER_KIND)) return;
   if (verbose && callableMember.getKind() != CallableMemberDescriptor.Kind.DECLARATION) {
     builder.append("/*").append(callableMember.getKind().name().toLowerCase()).append("*/ ");
   }
 }