public static @Nullable TextRange getPossibleDeclarationAtRange(final PsiElement container) { DeclarationRangeHandler handler = MixinExtension.getInstance(DeclarationRangeHandler.EP_NAME, container); if (handler != null) { return handler.getDeclarationRange(container); } else { for(Class clazz:ourDeclarationRangeRegistry.keySet()) { if (clazz.isInstance(container)) { final DeclarationRangeHandler handler2 = ourDeclarationRangeRegistry.get(clazz); if (handler2 != null) return handler2.getDeclarationRange(container); } } return null; } }