boolean (PsiVariable variable) { if (variable instanceof ImplicitVariable) return false; int startOffset; int endOffset; if (myExpression != null) { final TextRange range = myExpression.getTextRange(); startOffset = range.getStartOffset(); endOffset = range.getEndOffset(); } else { startOffset = myElements[0].getTextRange().getStartOffset(); endOffset = myElements[myElements.length - 1].getTextRange().getEndOffset(); } PsiIdentifier nameIdentifier = variable.getNameIdentifier(); if (nameIdentifier == null) return false; final TextRange range = nameIdentifier.getTextRange(); if (range == null) return false; int offset = range.getStartOffset(); return startOffset <= offset && offset <= endOffset; }