VariableInplaceRenamer (@NotNull PsiElement elementToRename, @NotNull Editor editor) { PossiblePrefixReference reference = getReference(elementToRename.getContainingFile(), editor); if (reference != null) { PsiElement prefix = reference.resolve(); if (prefix instanceof SchemaPrefix) { return new VariableInplaceRenamer((PsiNamedElement)prefix, editor) { @Override protected void addReferenceAtCaret(Collection<? super PsiReference> refs) {} @Override protected boolean isReferenceAtCaret(PsiElement selectedElement, PsiReference ref) { return false; } }; } } return null; }