mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
[java-highlighting] Avoid highlighting outside of PsiField psi element
Fixes IDEA-368916 IAE in error highlighting when several fields are declared with shared modifier list GitOrigin-RevId: 012b6564f9ca1a775894a3fc2b003c4feb2477e6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f3ac3c8925
commit
830860950b
@@ -158,7 +158,8 @@ final class JavaErrorFormatUtil {
|
||||
static @NotNull TextRange getFieldDeclarationTextRange(@NotNull PsiField field) {
|
||||
PsiModifierList modifierList = field.getModifierList();
|
||||
TextRange range = field.getTextRange();
|
||||
int start = modifierList == null ? range.getStartOffset() : stripAnnotationsFromModifierList(modifierList);
|
||||
int start = modifierList == null || modifierList.getParent() != field ?
|
||||
range.getStartOffset() : stripAnnotationsFromModifierList(modifierList);
|
||||
int end = field.getNameIdentifier().getTextRange().getEndOffset();
|
||||
return new TextRange(start, end).shiftLeft(range.getStartOffset());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user