mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't shift text range if the element has no last child (PY-11344)
This commit is contained in:
@@ -561,13 +561,13 @@ public class PyUnresolvedReferencesInspection extends PyInspection {
|
||||
|
||||
final PsiElement point;
|
||||
final TextRange range;
|
||||
if (reference instanceof PyOperatorReference) {
|
||||
final PsiElement lastChild = node.getLastChild();
|
||||
if (reference instanceof PyOperatorReference || lastChild == null) {
|
||||
point = node;
|
||||
range = rangeInElement;
|
||||
}
|
||||
else {
|
||||
final PsiElement lastChild = node.getLastChild();
|
||||
point = lastChild != null ? lastChild : node; // usually the identifier at the end of qual ref
|
||||
point = lastChild; // usually the identifier at the end of qual ref
|
||||
range = rangeInElement.shiftRight(-point.getStartOffsetInParent());
|
||||
}
|
||||
if (reference instanceof PyImportReference && refname != null) {
|
||||
|
||||
Reference in New Issue
Block a user