Examples of IScope


Examples of org.aspectj.weaver.patterns.IScope

    String argumentNames = getArgNamesValue(pointcut);
    if (argumentNames != null) {
      struct.unparsedArgumentNames = argumentNames;
    }
    // this/target/args binding
    final IScope binding;
    try {
      if (struct.method.isAbstract()) {
        binding = null;
      } else {
        binding = new BindingScope(struct.enclosingType, struct.context, extractBindings(struct));
View Full Code Here

Examples of org.eclipse.core.runtime.preferences.IScope

    public void registryChanged( IRegistryChangeEvent event ) {
    }
  
    protected IEclipsePreferences createNode(String name) {
        IScope scope = null;
        Object value = scopeRegistry.get(name);
        if (value instanceof IConfigurationElement) {
            try {
                scope = (IScope) ((IConfigurationElement) value).createExecutableExtension(ATTRIBUTE_CLASS);
                scopeRegistry.put(name, scope);
            } catch (ClassCastException e) {
//                log(createStatusError(Messages.preferences_classCastScope, e));
                return new SLDPreferences(root, name);
            } catch (CoreException e) {
                log(e.getStatus());
                return new SLDPreferences(root, name);
            }
        } else
            scope = (IScope) value;
        return scope.create(root, name);
    }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

      return Collections.<EObject> emptyList();

    final String crossRefString = getCrossRefNodeAsString(node);
    if (crossRefString != null && !crossRefString.equals("")) {
      linkNode = node;
      final IScope scope = getScope(context, ref);
      linkNode = null;
      QualifiedName qualifiedLinkName =  qualifiedNameConverter.toQualifiedName(crossRefString);
      IEObjectDescription eObjectDescription = scope.getSingleElement(qualifiedLinkName);
      if (eObjectDescription != null)
        return Collections.singletonList(eObjectDescription.getEObjectOrProxy());
    }
    return Collections.emptyList();
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  // service ABC {
  //   option (code) = 68;
  // }
  @Test public void should_support_Service_options() {
    Option option = xtext.find("code", ")", Option.class);
    IScope scope = scopeProvider.scope_OptionSource_target(option.getSource(), reference);
    assertThat(descriptionsIn(scope), containAll("code", "proto.code", "google.proto.code", "com.google.proto.code",
                                                 ".com.google.proto.code",
                                                 "info", "proto.info", "google.proto.info", "com.google.proto.info",
                                                 ".com.google.proto.info"));
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  // enum PhoneType {
  //   HOME = 0 [(active) = true];
  // }
  @Test public void should_provide_fields_for_custom_field_option() {
    CustomFieldOption option = xtext.find("active", ")", CustomFieldOption.class);
    IScope scope = scopeProvider.scope_OptionSource_target(option.getSource(), reference);
    assertThat(descriptionsIn(scope), containAll("active", ".active"));
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  // message Summary {
  //   repeated base.shared.Type type = 1;
  // }
  @Test public void should_include_package_intersection() {
    MessageField field = xtext.find("type", " =", MessageField.class);
    IScope scope = scopeProvider.scope_ComplexTypeLink_target((ComplexTypeLink) field.getType(), reference);
    assertThat(descriptionsIn(scope), contain("base.shared.Type", "proto.base.shared.Type",
                                              "google.proto.base.shared.Type", "com.google.proto.base.shared.Type"));
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  //     optional MyGroup mygroup = 2207766;
  //   }
  // }
  @Test public void should_treat_groups_as_types() {
    MessageField field = xtext.find("mygroup", MessageField.class);
    IScope scope = scopeProvider.scope_ComplexTypeLink_target((ComplexTypeLink) field.getType(), reference);
    assertThat(descriptionsIn(scope), contain("Root.MyGroup", "MyGroup"));
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  // }
  @Test public void should_find_closest_type_possible() {
    Literal active = xtext.find("ACTIVE", " = 0", Literal.class);
    MessageField field = xtext.find("status", MessageField.class);
    ComplexTypeLink link = (ComplexTypeLink) field.getType();
    IScope scope = scopeProvider.scope_ComplexTypeLink_target(link, reference);
    EObject status = descriptionsIn(scope).objectDescribedAs("Status");
    assertSame(active.eContainer(), status);
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  //     required int64 groupId = 2;
  //   }
  // }
  @Test public void should_provide_fields_for_native_option() {
    NativeFieldOption option = xtext.find("deprecated", NativeFieldOption.class);
    IScope scope = scopeProvider.scope_OptionSource_target(option.getSource(), reference);
    Group group = xtext.find("membership", Group.class);
    ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
    Collection<MessageField> optionSources = descriptor.availableOptionsFor(group);
    assertThat(descriptionsIn(scope), containAll(optionSources));
  }
View Full Code Here

Examples of org.eclipse.xtext.scoping.IScope

  //     required int64 groupId = 2;
  //   }
  // }
  @Test public void should_provide_fields_for_custom_option() {
    CustomFieldOption option = xtext.find("code", ")", CustomFieldOption.class);
    IScope scope = scopeProvider.scope_OptionSource_target(option.getSource(), reference);
    assertThat(descriptionsIn(scope), containAll("code", "proto.code", "google.proto.code", "com.google.proto.code",
                                                 ".com.google.proto.code",
                                                 "info", "proto.info", "google.proto.info", "com.google.proto.info",
                                                 ".com.google.proto.info"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.