Examples of CustomFieldOption


Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  //
  // message Person {
  //   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

Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  //
  // message Person {
  //   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

Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  }

  @Override public void completeCustomFieldOption_Fields(EObject model, Assignment assignment,
      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if (model instanceof CustomFieldOption) {
      CustomFieldOption option = (CustomFieldOption) model;
      proposeAndAccept(scopeProvider().potentialMessageFieldsFor(option), context, acceptor);
      proposeExtensionFields(scopeProvider().potentialExtensionFieldsFor(option), context, acceptor);
    }
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  @Override public void completeCustomFieldOption_Value(EObject model, Assignment assignment,
      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    // TODO content assist returns "{"
    if (model instanceof CustomFieldOption) {
      // TODO check if this is the same as sourceOf
      CustomFieldOption option = (CustomFieldOption) model;
      IndexedElement e = options.sourceOfLastFieldIn(option);
      if (e == null) {
        e = options.rootSourceOf(option);
      }
      if (e instanceof MessageField) {
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  //
  // message Person {
  //   optional boolean active = 1 [(custom).count = 6];
  // }
  @Test public void should_return_option_field() {
    CustomFieldOption option = xtext.find("custom", ").", CustomFieldOption.class);
    MessageField field = (MessageField) options.sourceOfLastFieldIn(option);
    assertThat(field.getName(), equalTo("count"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  //
  // message Person {
  //   optional boolean active = 1 [(custom).count = 6];
  // }
  @Test public void should_return_option_field() {
    CustomFieldOption option = xtext.find("custom", ").", CustomFieldOption.class);
    List<OptionField> fields = option.getFields();
    assertThat(options.fieldsOf(option), equalTo(fields));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.CustomFieldOption

  //
  // message Person {
  //   optional boolean active = 1 [(code) = 68];
  // }
  @Test public void should_provide_sources_for_custom_field_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.