diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-14 16:07:37 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-14 16:07:37 +0400 |
commit | f3375a48e593a78faaa167f46cef02c18c1160bb (patch) | |
tree | 1efbcb7eb030a658d687bcdbd116767eb9a67e25 /src/Analysis | |
parent | 08e690021ce2df402134ea5cebd769183499c771 (diff) | |
download | dokka-f3375a48e593a78faaa167f46cef02c18c1160bb.tar.gz dokka-f3375a48e593a78faaa167f46cef02c18c1160bb.tar.bz2 dokka-f3375a48e593a78faaa167f46cef02c18c1160bb.zip |
Get members scope for packages from PacakgeViews
Diffstat (limited to 'src/Analysis')
-rw-r--r-- | src/Analysis/CompilerAPI.kt | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/Analysis/CompilerAPI.kt b/src/Analysis/CompilerAPI.kt index b2b9a824..66e8a76c 100644 --- a/src/Analysis/CompilerAPI.kt +++ b/src/Analysis/CompilerAPI.kt @@ -66,8 +66,8 @@ fun DeclarationDescriptor.isUserCode() = public fun getPackageInnerScope(descriptor: PackageFragmentDescriptor): JetScope { val module = descriptor.getContainingDeclaration() - val packageScope = ChainedScope(descriptor, "Package ${descriptor.getName()} scope", descriptor.getMemberScope(), - module.getPackage(FqName.ROOT)!!.getMemberScope()) + val packageView = module.getPackage(descriptor.fqName) + val packageScope = packageView!!.getMemberScope() return packageScope } @@ -131,11 +131,20 @@ public fun getPropertyInnerScope(outerScope: JetScope, descriptor: PropertyDescr fun BindingContext.getResolutionScope(descriptor: DeclarationDescriptor): JetScope { when (descriptor) { - is PackageFragmentDescriptor -> return getPackageInnerScope(descriptor) - is PackageViewDescriptor -> return descriptor.getMemberScope() - is ClassDescriptor -> return getClassInnerScope(getResolutionScope(descriptor.getContainingDeclaration()), descriptor) - is FunctionDescriptor -> return getFunctionInnerScope(getResolutionScope(descriptor.getContainingDeclaration()), descriptor) - is PropertyDescriptor -> return getPropertyInnerScope(getResolutionScope(descriptor.getContainingDeclaration()), descriptor) + is PackageFragmentDescriptor -> + return getPackageInnerScope(descriptor) + + is PackageViewDescriptor -> + return descriptor.getMemberScope() + + is ClassDescriptor -> + return getClassInnerScope(getResolutionScope(descriptor.getContainingDeclaration()), descriptor) + + is FunctionDescriptor -> + return getFunctionInnerScope(getResolutionScope(descriptor.getContainingDeclaration()), descriptor) + + is PropertyDescriptor -> + return getPropertyInnerScope(getResolutionScope(descriptor.getContainingDeclaration()), descriptor) } if (descriptor is DeclarationDescriptorNonRoot) |