Package org.eclipse.xtext.scoping

Examples of org.eclipse.xtext.scoping.IScope


  //
  // option (type).code = 68;
  @Test public void should_provide_message_fields_for_first_field_in_custom_option() {
    CustomOption option = xtext.find("type", ")", CustomOption.class);
    MessageOptionField codeOptionField = (MessageOptionField) option.getFields().get(0);
    IScope scope = scopeProvider.scope_OptionField_target(codeOptionField, reference);
    Message typeMessage = xtext.find("Type", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(typeMessage));
  }
View Full Code Here


  //
  // option (type).code.number = 68;
  @Test public void should_provide_message_fields_for_field_in_custom_option() {
    CustomOption option = xtext.find("type", ")", CustomOption.class);
    MessageOptionField numberOptionField = (MessageOptionField) option.getFields().get(1);
    IScope scope = scopeProvider.scope_OptionField_target(numberOptionField, reference);
    Message codeMessage = xtext.find("Code", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(codeMessage));
  }
View Full Code Here

  //
  // option (type).code = 68;
  @Test public void should_provide_group_fields_for_first_field_in_custom_option() {
    CustomOption option = xtext.find("type", ")", CustomOption.class, IGNORE_CASE);
    MessageOptionField codeOptionField = (MessageOptionField) option.getFields().get(0);
    IScope scope = scopeProvider.scope_OptionField_target(codeOptionField, reference);
    Group groupMessage = xtext.find("Type", " =", Group.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(groupMessage));
  }
View Full Code Here

  //   optional boolean active = 1 [(type).code = 68];
  // }
  @Test public void should_provide_message_fields_for_first_field_in_field_custom_option() {
    CustomFieldOption option = xtext.find("type", ")", CustomFieldOption.class);
    MessageOptionField codeOptionField = (MessageOptionField) option.getFields().get(0);
    IScope scope = scopeProvider.scope_OptionField_target(codeOptionField, reference);
    Message typeMessage = xtext.find("Type", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(typeMessage));
  }
View Full Code Here

  //   optional boolean active = 1 [(type).code.number = 68];
  // }
  @Test public void should_provide_message_fields_for_field_in_field_custom_option() {
    CustomFieldOption option = xtext.find("type", ")", CustomFieldOption.class);
    MessageOptionField numberOptionField = (MessageOptionField) option.getFields().get(1);
    IScope scope = scopeProvider.scope_OptionField_target(numberOptionField, reference);
    Message codeMessage = xtext.find("Code", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(codeMessage));
  }
View Full Code Here

  //   optional boolean active = 1 [(type).code = 68];
  // }
  @Test public void should_provide_group_fields_for_first_field_in_field_custom_option() {
    CustomFieldOption option = xtext.find("type", ")", CustomFieldOption.class, IGNORE_CASE);
    MessageOptionField codeOptionField = (MessageOptionField) option.getFields().get(0);
    IScope scope = scopeProvider.scope_OptionField_target(codeOptionField, reference);
    Group groupMessage = xtext.find("Type", " =", Group.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(groupMessage));
  }
View Full Code Here

  // message Contact {
  //   optional Type type = 1;
  // }
  @Test public void should_provide_Types() {
    MessageField field = xtext.find("type", MessageField.class);
    IScope scope = scopeProvider.scope_ComplexTypeLink_target(typeOf(field), reference);
    assertThat(descriptionsIn(scope), containAll("Type", "proto.Type", "google.proto.Type", "com.google.proto.Type",
                                                 ".com.google.proto.Type",
                                                 "Address", "proto.Address", "google.proto.Address",
                                                 "com.google.proto.Address", ".com.google.proto.Address",
                                                 "Contact", "proto.Contact", "google.proto.Contact",
View Full Code Here

  // message Contact {
  //   optional com.google.test.Type type = 1;
  // }
  @Test public void should_provide_imported_Types() {
    MessageField field = xtext.find("type", " =", MessageField.class);
    IScope scope = scopeProvider.scope_ComplexTypeLink_target(typeOf(field), reference);
    assertThat(descriptionsIn(scope), containAll("test.proto.Type", ".test.proto.Type",
                                                 "test.proto.Address", ".test.proto.Address",
                                                 "Contact", "proto.Contact", "google.proto.Contact",
                                                 "com.google.proto.Contact", ".com.google.proto.Contact"));
  }
View Full Code Here

  // message Contact {
  //   optional com.google.test.Type type = 1;
  // }
  @Test public void should_provide_imported_Types_with_equal_package() {
    MessageField field = xtext.find("type", " =", MessageField.class);
    IScope scope = scopeProvider.scope_ComplexTypeLink_target(typeOf(field), reference);
    assertThat(descriptionsIn(scope), containAll("Type", "proto.Type", "google.proto.Type", "com.google.proto.Type",
                                                 ".com.google.proto.Type",
                                                 "Address", "proto.Address", "google.proto.Address",
                                                 "com.google.proto.Address", ".com.google.proto.Address",
                                                 "Contact", "proto.Contact", "google.proto.Contact",
View Full Code Here

  // message Contact {
  //   optional test.proto.Type type = 1;
  // }
  @Test public void should_provide_public_imported_Types() {
    MessageField field = xtext.find("type", " =", MessageField.class);
    IScope scope = scopeProvider.scope_ComplexTypeLink_target(typeOf(field), reference);
    assertThat(descriptionsIn(scope), containAll("test.proto.Type", ".test.proto.Type",
                                                 "test.proto.Address", ".test.proto.Address",
                                                 "Contact", "proto.Contact", "google.proto.Contact",
                                                 "com.google.proto.Contact", ".com.google.proto.Contact"));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.scoping.IScope

Copyright © 2018 www.massapicom. 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.