Render '@' before each annotation
This commit is contained in:
+1
-1
@@ -104,7 +104,7 @@ private class CallableClsStubBuilder(
|
||||
|
||||
val kind = callableProto.annotatedCallableKind
|
||||
val annotationIds = c.components.annotationLoader.loadCallableAnnotations(protoContainer, callableProto, c.nameResolver, kind)
|
||||
createTargetedAnnotationStubs(annotationIds, modifierListStubImpl, needWrappingAnnotationEntries = isPrimaryConstructor)
|
||||
createTargetedAnnotationStubs(annotationIds, modifierListStubImpl)
|
||||
}
|
||||
|
||||
private fun doCreateCallableStub(): StubElement<out PsiElement> {
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
||||
}
|
||||
|
||||
private fun createTypeAnnotationStubs(parent: KotlinStubBaseImpl<*>, annotations: List<ClassId>) {
|
||||
createAnnotationStubs(annotations, parent, needWrappingAnnotationEntries = true)
|
||||
createAnnotationStubs(annotations, parent)
|
||||
}
|
||||
|
||||
private fun createTypeArgumentListStub(typeStub: KotlinUserTypeStub, typeArgumentProtoList: List<Type.Argument>) {
|
||||
|
||||
+4
-9
@@ -216,25 +216,20 @@ fun createModifierListStub(
|
||||
)
|
||||
}
|
||||
|
||||
fun createAnnotationStubs(annotationIds: List<ClassId>, parent: KotlinStubBaseImpl<*>, needWrappingAnnotationEntries: Boolean = false) {
|
||||
return createTargetedAnnotationStubs(annotationIds.map { ClassIdWithTarget(it, null) }, parent, needWrappingAnnotationEntries)
|
||||
fun createAnnotationStubs(annotationIds: List<ClassId>, parent: KotlinStubBaseImpl<*>) {
|
||||
return createTargetedAnnotationStubs(annotationIds.map { ClassIdWithTarget(it, null) }, parent)
|
||||
}
|
||||
|
||||
fun createTargetedAnnotationStubs(
|
||||
annotationIds: List<ClassIdWithTarget>,
|
||||
parent: KotlinStubBaseImpl<*>,
|
||||
needWrappingAnnotationEntries: Boolean = false
|
||||
parent: KotlinStubBaseImpl<*>
|
||||
) {
|
||||
if (annotationIds.isEmpty()) return
|
||||
|
||||
val entriesParent =
|
||||
if (needWrappingAnnotationEntries) KotlinPlaceHolderStubImpl<JetAnnotation>(parent, JetStubElementTypes.ANNOTATION)
|
||||
else parent
|
||||
|
||||
annotationIds.forEach { annotation ->
|
||||
val (annotationClassId, target) = annotation
|
||||
val annotationEntryStubImpl = KotlinAnnotationEntryStubImpl(
|
||||
entriesParent,
|
||||
parent,
|
||||
shortName = annotationClassId.getShortClassName().ref(),
|
||||
hasValueArguments = false
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user