mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
allow override implementation handlers to customize result
https://github.com/JetBrains/intellij-community/pull/824
This commit is contained in:
+9
-6
@@ -56,14 +56,17 @@ public interface OverrideImplementsAnnotationsHandler {
|
||||
|
||||
int flags = CHECK_EXTERNAL | CHECK_TYPE;
|
||||
if (AnnotationUtil.isAnnotated(source, annotation, flags) && !AnnotationUtil.isAnnotated(target, annotation, flags)) {
|
||||
PsiModifierList modifierList = target.getModifierList();
|
||||
assert modifierList != null : target;
|
||||
PsiAnnotation srcAnnotation = AnnotationUtil.findAnnotation(source, annotation);
|
||||
PsiNameValuePair[] valuePairs = srcAnnotation != null ? srcAnnotation.getParameterList().getAttributes()
|
||||
: PsiNameValuePair.EMPTY_ARRAY;
|
||||
AddAnnotationPsiFix.addPhysicalAnnotation(annotation, valuePairs, modifierList);
|
||||
each.transferToTarget(annotation, source, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default void transferToTarget(String annotation, PsiModifierListOwner source, PsiModifierListOwner target) {
|
||||
PsiModifierList modifierList = target.getModifierList();
|
||||
assert modifierList != null : target;
|
||||
PsiAnnotation srcAnnotation = AnnotationUtil.findAnnotation(source, annotation);
|
||||
PsiNameValuePair[] valuePairs = srcAnnotation != null ? srcAnnotation.getParameterList().getAttributes() : PsiNameValuePair.EMPTY_ARRAY;
|
||||
AddAnnotationPsiFix.addPhysicalAnnotation(annotation, valuePairs, modifierList);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user