mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:10:43 +07:00
[kotlin] fix "Add annotation" quickfix in K2 mode (KTIJ-31459)
In regular cases 'annotationTarget' is null, so the empty prefix should be used instead of silently exiting. 'addAnnotationEntry' in K1 works this way. GitOrigin-RevId: 0ee53829a2575b6d57b6c14f927e80b4c482af3c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c656bfdf25
commit
f7eeedb6a1
@@ -204,14 +204,11 @@ object K2CreatePropertyFromUsageBuilder {
|
||||
request: AnnotationRequest,
|
||||
annotationTarget: AnnotationUseSiteTarget?
|
||||
): KtAnnotationEntry? {
|
||||
|
||||
if (annotationTarget == null) return null
|
||||
|
||||
val declaration = target as? KtDeclaration ?: return null
|
||||
val classId = ClassId.topLevel(FqName(request.qualifiedName))
|
||||
|
||||
val annotationUseSiteTargetPrefix =
|
||||
if (isApplicableTargetSet(declaration, classId, fieldAnnotationTargetCallableId)) {
|
||||
if (annotationTarget == null || isApplicableTargetSet(declaration, classId, fieldAnnotationTargetCallableId)) {
|
||||
""
|
||||
} else {
|
||||
"${annotationTarget.renderName}:"
|
||||
|
||||
Reference in New Issue
Block a user