mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Fix navigation to library ctor value parameters
#KTIJ-33060 GitOrigin-RevId: bdcf3704bddc7dde65eb29aa2cc2c6499b75107e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
99e6f2e4b7
commit
eef850617b
+10
-3
@@ -159,10 +159,17 @@ internal class KotlinAnalysisApiBasedDeclarationNavigationPolicyImpl : KotlinDec
|
||||
else -> {
|
||||
val correspondingOwner = getCorrespondingClassLikeDeclaration(containingClass, scope, module) as? KtClassOrObject
|
||||
?: return null
|
||||
if (declaration is KtProperty && correspondingOwner.isData() && !declaration.isExtensionDeclaration() && declaration.typeParameters.isEmpty()) {
|
||||
correspondingOwner.primaryConstructor?.valueParameters?.firstOrNull { it.name == declarationName }?.let { return it }
|
||||
val declarations = correspondingOwner.declarations
|
||||
if (declaration is KtProperty) {
|
||||
declarations.firstOrNull { it is KtProperty && it.name == declaration.name }
|
||||
?.let { return it }
|
||||
|
||||
if (!declaration.isExtensionDeclaration() && declaration.typeParameters.isEmpty()) {
|
||||
correspondingOwner.primaryConstructor?.valueParameters?.firstOrNull { it.name == declarationName }
|
||||
?.let { return it }
|
||||
}
|
||||
}
|
||||
correspondingOwner.declarations
|
||||
declarations
|
||||
}
|
||||
}
|
||||
return chooseCallableCandidate(declaration, candidates)
|
||||
|
||||
+5
@@ -158,6 +158,11 @@ public abstract class KotlinNavigationToLibrarySourceTestGenerated extends Abstr
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("ctorParameter.kt")
|
||||
public void testCtorParameter() throws Exception {
|
||||
runTest("testData/navigationToLibrarySourcePolicy/resolveToStdlib/properties/ctorParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dataClass.kt")
|
||||
public void testDataClass() throws Exception {
|
||||
runTest("testData/navigationToLibrarySourcePolicy/resolveToStdlib/properties/dataClass.kt");
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun f() {
|
||||
val b: HexFormat.BytesHexFormat? = null
|
||||
b?.bytesPe<caret>rLine
|
||||
}
|
||||
|
||||
// REF: (kotlin.text.HexFormat.BytesHexFormat @ jar://kotlin-stdlib-sources.jar!/commonMain/kotlin/text/HexFormat.kt) public val bytesPerLine: Int
|
||||
Reference in New Issue
Block a user