mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] k2: fix annotation with arguments presentation
KTIJ-30695 GitOrigin-RevId: 681e7f73c1d1c6a2713599fd26915960e11b145c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b27ed90ff3
commit
c6fee8bfc9
+1
-1
@@ -39,7 +39,7 @@ data class ExtractableCodeDescriptor(
|
||||
get() = if (renderedAnnotations.isEmpty()) {
|
||||
""
|
||||
} else {
|
||||
renderedAnnotations.joinToString(separator = "\n", postfix = "\n")
|
||||
renderedAnnotations.joinToString(separator = "\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -228,6 +228,7 @@ internal class ExtractionDataAnalyzer(private val extractionData: ExtractionData
|
||||
printer.append('@')
|
||||
renderer.annotationUseSiteTargetRenderer.renderUseSiteTarget(useSiteSession, annotation, owner, renderer, printer)
|
||||
renderer.annotationsQualifiedNameRenderer.renderQualifier(useSiteSession, annotation, owner, renderer, printer)
|
||||
renderer.annotationArgumentsRenderer.renderAnnotationArguments(useSiteSession, annotation, owner, renderer, printer)
|
||||
printer.append('\n')
|
||||
printer.toString()
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,13 +40,13 @@ private class MyComposeExtractFunctionDescriptorModifier : ExtractFunctionDescri
|
||||
if (sourceFunction is KtAnnotated) {
|
||||
sourceFunction.findAnnotation(MY_COMPOSABLE_CLASS_ID)?.let {
|
||||
return descriptor.copy(
|
||||
renderedAnnotations = descriptor.renderedAnnotations + "@${MY_COMPOSABLE_CLASS_ID.asFqNameString()}"
|
||||
renderedAnnotations = descriptor.renderedAnnotations + "@${MY_COMPOSABLE_CLASS_ID.asFqNameString()}\n"
|
||||
)
|
||||
}
|
||||
}
|
||||
val outsideLambda = descriptor.extractionData.commonParent.parentOfType<KtLambdaArgument>(true) ?: return descriptor
|
||||
return if (outsideLambda.isComposable()) {
|
||||
descriptor.copy(renderedAnnotations = descriptor.renderedAnnotations + "@${MY_COMPOSABLE_CLASS_ID.asFqNameString()}")
|
||||
descriptor.copy(renderedAnnotations = descriptor.renderedAnnotations + "@${MY_COMPOSABLE_CLASS_ID.asFqNameString()}\n")
|
||||
} else {
|
||||
descriptor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user