コード例 #1
0
  @Nullable
  public static PyType getReferenceTypeFromProviders(
      @NotNull final PsiElement target, TypeEvalContext context, @Nullable PsiElement anchor) {
    for (PyTypeProvider provider : Extensions.getExtensions(PyTypeProvider.EP_NAME)) {
      final PyType result = provider.getReferenceType(target, context, anchor);
      if (result != null) return result;
    }

    return null;
  }
コード例 #2
0
 @Nullable
 private PyType getTypeFromProviders(@NotNull TypeEvalContext context) {
   for (PyTypeProvider provider : Extensions.getExtensions(PyTypeProvider.EP_NAME)) {
     try {
       final PyType type = provider.getReferenceExpressionType(this, context);
       if (type != null) {
         return type;
       }
     } catch (AbstractMethodError e) {
       LOG.info(new ExtensionException(provider.getClass()));
     }
   }
   return null;
 }