resolve KDoc references to members of companion object
This commit is contained in:
@@ -138,10 +138,17 @@ private fun getClassInnerScope(outerScope: LexicalScope, descriptor: ClassDescri
|
|||||||
addFunctionDescriptor(constructor)
|
addFunctionDescriptor(constructor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val scopeChain = arrayListOf(descriptor.defaultType.memberScope,
|
||||||
|
descriptor.staticScope)
|
||||||
|
|
||||||
|
descriptor.companionObjectDescriptor?.let {
|
||||||
|
scopeChain.add(it.defaultType.memberScope)
|
||||||
|
}
|
||||||
|
|
||||||
return LexicalChainedScope(headerScope, descriptor, false, null,
|
return LexicalChainedScope(headerScope, descriptor, false, null,
|
||||||
"Class ${descriptor.name} scope",
|
"Class ${descriptor.name} scope",
|
||||||
descriptor.defaultType.memberScope,
|
*scopeChain.toTypedArray())
|
||||||
descriptor.staticScope)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun getResolutionScope(resolutionFacade: ResolutionFacade, descriptor: DeclarationDescriptor): LexicalScope {
|
public fun getResolutionScope(resolutionFacade: ResolutionFacade, descriptor: DeclarationDescriptor): LexicalScope {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/** See [Foo.b<caret>ar] */
|
||||||
|
class T {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
companion object {
|
||||||
|
fun bar() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// REF: (in Foo.Companion).bar()
|
||||||
@@ -60,6 +60,12 @@ public class KdocResolveTestGenerated extends AbstractReferenceResolveTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("CompanionObjectMember.kt")
|
||||||
|
public void testCompanionObjectMember() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/kdoc/resolve/CompanionObjectMember.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ConstructorParamReference.kt")
|
@TestMetadata("ConstructorParamReference.kt")
|
||||||
public void testConstructorParamReference() throws Exception {
|
public void testConstructorParamReference() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/kdoc/resolve/ConstructorParamReference.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/kdoc/resolve/ConstructorParamReference.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user