PsiElement (@Nullable PsiElement source, Editor editor) { if (source != null && source.getLanguage() instanceof RestLanguage) { RestReference ref = PsiTreeUtil.getParentOfType(source, RestReference.class); if (ref != null) { return ref.resolve(); } } return null; }