Do not expect that KDoc reference contains importable fqName
#KT-31768 Fixed
This commit is contained in:
@@ -173,7 +173,7 @@ class KotlinCopyPasteReferenceProcessor : CopyPastePostProcessor<KotlinReference
|
|||||||
|
|
||||||
if (!reference.canBeResolvedViaImport(descriptor, bindingContext)) continue
|
if (!reference.canBeResolvedViaImport(descriptor, bindingContext)) continue
|
||||||
|
|
||||||
val fqName = descriptor.importableFqName!!
|
val fqName = descriptor.importableFqName ?: continue
|
||||||
val kind = KotlinReferenceData.Kind.fromDescriptor(descriptor) ?: continue
|
val kind = KotlinReferenceData.Kind.fromDescriptor(descriptor) ?: continue
|
||||||
val isQualifiable = KotlinReferenceData.isQualifiable(ktElement, descriptor)
|
val isQualifiable = KotlinReferenceData.isQualifiable(ktElement, descriptor)
|
||||||
val relativeStart = ktElement.range.start - startOffset
|
val relativeStart = ktElement.range.start - startOffset
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package goo
|
||||||
|
|
||||||
|
import foo.Base
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property param
|
||||||
|
*/
|
||||||
|
class Impl : Base(1)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
foo.Base
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
abstract class Base(val param: Int)
|
||||||
|
|
||||||
|
<selection>/**
|
||||||
|
* @property param
|
||||||
|
*/
|
||||||
|
class Impl : Base(1)</selection>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package goo
|
||||||
|
|
||||||
|
<caret>
|
||||||
+10
@@ -76,6 +76,11 @@ public class InsertImportOnPasteTestGenerated extends AbstractInsertImportOnPast
|
|||||||
runTest("idea/testData/copyPaste/imports/ClassType.kt");
|
runTest("idea/testData/copyPaste/imports/ClassType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassWithDoc.kt")
|
||||||
|
public void testClassWithDoc() throws Exception {
|
||||||
|
runTest("idea/testData/copyPaste/imports/ClassWithDoc.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ConflictForTypeWithTypeParameter.kt")
|
@TestMetadata("ConflictForTypeWithTypeParameter.kt")
|
||||||
public void testConflictForTypeWithTypeParameter() throws Exception {
|
public void testConflictForTypeWithTypeParameter() throws Exception {
|
||||||
runTest("idea/testData/copyPaste/imports/ConflictForTypeWithTypeParameter.kt");
|
runTest("idea/testData/copyPaste/imports/ConflictForTypeWithTypeParameter.kt");
|
||||||
@@ -414,6 +419,11 @@ public class InsertImportOnPasteTestGenerated extends AbstractInsertImportOnPast
|
|||||||
runTest("idea/testData/copyPaste/imports/ClassType.kt");
|
runTest("idea/testData/copyPaste/imports/ClassType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassWithDoc.kt")
|
||||||
|
public void testClassWithDoc() throws Exception {
|
||||||
|
runTest("idea/testData/copyPaste/imports/ClassWithDoc.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ConflictForTypeWithTypeParameter.kt")
|
@TestMetadata("ConflictForTypeWithTypeParameter.kt")
|
||||||
public void testConflictForTypeWithTypeParameter() throws Exception {
|
public void testConflictForTypeWithTypeParameter() throws Exception {
|
||||||
runTest("idea/testData/copyPaste/imports/ConflictForTypeWithTypeParameter.kt");
|
runTest("idea/testData/copyPaste/imports/ConflictForTypeWithTypeParameter.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user