Do not expect that KDoc reference contains importable fqName

#KT-31768 Fixed
This commit is contained in:
Alexander Podkhalyuzin
2019-06-06 16:28:48 +03:00
parent 71604851fe
commit ea86ebf995
6 changed files with 31 additions and 1 deletions
@@ -173,7 +173,7 @@ class KotlinCopyPasteReferenceProcessor : CopyPastePostProcessor<KotlinReference
if (!reference.canBeResolvedViaImport(descriptor, bindingContext)) continue
val fqName = descriptor.importableFqName!!
val fqName = descriptor.importableFqName ?: continue
val kind = KotlinReferenceData.Kind.fromDescriptor(descriptor) ?: continue
val isQualifiable = KotlinReferenceData.isQualifiable(ktElement, descriptor)
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
+8
View File
@@ -0,0 +1,8 @@
package foo
abstract class Base(val param: Int)
<selection>/**
* @property param
*/
class Impl : Base(1)</selection>
+3
View File
@@ -0,0 +1,3 @@
package goo
<caret>
@@ -76,6 +76,11 @@ public class InsertImportOnPasteTestGenerated extends AbstractInsertImportOnPast
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")
public void testConflictForTypeWithTypeParameter() throws Exception {
runTest("idea/testData/copyPaste/imports/ConflictForTypeWithTypeParameter.kt");
@@ -414,6 +419,11 @@ public class InsertImportOnPasteTestGenerated extends AbstractInsertImportOnPast
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")
public void testConflictForTypeWithTypeParameter() throws Exception {
runTest("idea/testData/copyPaste/imports/ConflictForTypeWithTypeParameter.kt");