Example #1
0
  protected List<IJvmFeatureDescriptionProvider> getFeatureDescriptionProviders(
      JvmTypeReference type,
      EObject expression,
      JvmDeclaredType currentContext,
      XExpression implicitReceiver) {
    DefaultJvmFeatureDescriptionProvider provider1 = newDefaultFeatureDescProvider();
    XFeatureCallSugarDescriptionProvider provider2 = newSugarDescriptionProvider();

    StaticMethodsFeatureForTypeProvider staticExtensionsProvider =
        newImplicitStaticFeaturesProvider();
    staticExtensionsProvider.setContext(expression.eResource());
    staticExtensionsProvider.setExtensionProvider(true);

    DefaultJvmFeatureDescriptionProvider provider3 = newDefaultFeatureDescProvider();
    provider3.setFeaturesForTypeProvider(staticExtensionsProvider);

    XFeatureCallSugarDescriptionProvider provider4 = newSugarDescriptionProvider();
    provider4.setFeaturesForTypeProvider(staticExtensionsProvider);

    provider1.setContextType(currentContext);
    provider1.setImplicitReceiver(implicitReceiver);
    provider2.setContextType(currentContext);
    provider2.setImplicitReceiver(implicitReceiver);
    provider3.setContextType(currentContext);
    provider3.setImplicitReceiver(implicitReceiver);
    provider4.setContextType(currentContext);
    provider4.setImplicitReceiver(implicitReceiver);

    List<IJvmFeatureDescriptionProvider> result =
        Lists.<IJvmFeatureDescriptionProvider>newArrayList(
            provider1, provider2, provider3, provider4);
    return result;
  }
Example #2
0
  protected List<IJvmFeatureDescriptionProvider> getStaticFeatureDescriptionProviders(
      Resource context, JvmDeclaredType contextType) {
    StaticMethodsFeatureForTypeProvider staticProvider = newImplicitStaticFeaturesProvider();
    staticProvider.setContext(context);

    DefaultJvmFeatureDescriptionProvider defaultProvider = newDefaultFeatureDescProvider();
    XFeatureCallSugarDescriptionProvider sugarProvider = newSugarDescriptionProvider();

    defaultProvider.setContextType(contextType);
    defaultProvider.setFeaturesForTypeProvider(staticProvider);
    sugarProvider.setContextType(contextType);
    sugarProvider.setFeaturesForTypeProvider(staticProvider);

    return Lists.<IJvmFeatureDescriptionProvider>newArrayList(defaultProvider, sugarProvider);
  }