More precise descriptor kind filtering (preparing to optimize smart completion)
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ public class DeserializedClassDescriptor(outerContext: DeserializationContext, p
|
||||
if (classId.isTopLevelClass()) {
|
||||
val fragments = context.packageFragmentProvider.getPackageFragments(classId.getPackageFqName())
|
||||
assert(fragments.size() == 1) { "there should be exactly one package: $fragments, class id is $classId" }
|
||||
return fragments.iterator().next()
|
||||
return fragments.single()
|
||||
}
|
||||
else {
|
||||
return context.deserializeClass(classId.getOuterClassId()) ?: ErrorUtils.getErrorModule()
|
||||
|
||||
+2
-2
@@ -107,7 +107,7 @@ public abstract class DeserializedMemberScope protected(
|
||||
|
||||
for (name in membersProtos().keySet()) {
|
||||
if (nameFilter(name)) {
|
||||
if (kindFilter(JetScope.DescriptorKind.NON_EXTENSION_FUNCTION) || kindFilter(JetScope.DescriptorKind.EXTENSION_FUNCTION)) {
|
||||
if (kindFilter(JetScope.DescriptorKind.ORDINARY_FUNCTION) || kindFilter(JetScope.DescriptorKind.EXTENSION_FUNCTION)) {
|
||||
result.addAll(getFunctions(name))
|
||||
}
|
||||
if (kindFilter(JetScope.DescriptorKind.NON_EXTENSION_PROPERTY) || kindFilter(JetScope.DescriptorKind.EXTENSION_PROPERTY)) {
|
||||
@@ -118,7 +118,7 @@ public abstract class DeserializedMemberScope protected(
|
||||
|
||||
addNonDeclaredDescriptors(result)
|
||||
|
||||
if (kindFilter(JetScope.DescriptorKind.CLASSIFIER)) {
|
||||
if (kindFilter(JetScope.DescriptorKind.TYPE) || kindFilter(JetScope.DescriptorKind.OBJECT) || kindFilter(JetScope.DescriptorKind.ENUM_ENTRY)) {
|
||||
addClassDescriptors(result, nameFilter)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user