PsiElement (@NotNull PsiFile file, int offset) { PsiElement e = file.findElementAt(offset); if (!(e instanceof LeafPsiElement leaf)) return null; if (leaf.getElementType() == ShTypes.VAR) return leaf; if (isStringOfVar(leaf)) return leaf.getPrevSibling(); return null; }