Search in sources :

Example 1 with PossiblePrefixReference

use of com.intellij.psi.impl.source.xml.PossiblePrefixReference in project intellij-community by JetBrains.

the class SchemaPrefixRenameHandler method getReference.

@Nullable
private static PossiblePrefixReference getReference(PsiFile file, Editor editor) {
    if (file != null && editor != null) {
        int offset = editor.getCaretModel().getOffset();
        PsiReference reference = file.findReferenceAt(offset);
        if (reference instanceof PossiblePrefixReference) {
            return (PossiblePrefixReference) reference;
        }
    }
    return null;
}
Also used : PossiblePrefixReference(com.intellij.psi.impl.source.xml.PossiblePrefixReference) PsiReference(com.intellij.psi.PsiReference) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsiReference (com.intellij.psi.PsiReference)1 PossiblePrefixReference (com.intellij.psi.impl.source.xml.PossiblePrefixReference)1 Nullable (org.jetbrains.annotations.Nullable)1