Search in sources :

Example 1 with SubpackagesScope

use of org.jetbrains.kotlin.descriptors.impl.SubpackagesScope in project kotlin by JetBrains.

the class RecursiveDescriptorComparator method getPackageScopeInModule.

@NotNull
private MemberScope getPackageScopeInModule(@NotNull PackageViewDescriptor descriptor, @NotNull ModuleDescriptor module) {
    // See LazyPackageViewDescriptorImpl#memberScope
    List<MemberScope> scopes = new ArrayList<MemberScope>();
    for (PackageFragmentDescriptor fragment : descriptor.getFragments()) {
        if (isFromModule(fragment, module)) {
            scopes.add(fragment.getMemberScope());
        }
    }
    scopes.add(new SubpackagesScope(module, descriptor.getFqName()));
    return ChainedMemberScope.Companion.create("test", scopes);
}
Also used : ArrayList(java.util.ArrayList) MemberScope(org.jetbrains.kotlin.resolve.scopes.MemberScope) ChainedMemberScope(org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope) SubpackagesScope(org.jetbrains.kotlin.descriptors.impl.SubpackagesScope) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1 SubpackagesScope (org.jetbrains.kotlin.descriptors.impl.SubpackagesScope)1 ChainedMemberScope (org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope)1 MemberScope (org.jetbrains.kotlin.resolve.scopes.MemberScope)1