Package com.google.eclipse.protobuf.protobuf

Examples of com.google.eclipse.protobuf.protobuf.NativeFieldOption


  //   repeated group membership = 1 [deprecated = true] {
  //     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


  }

  @Override public void completeNativeFieldOption_Value(EObject model, Assignment assignment,
      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if (model instanceof NativeFieldOption) {
      NativeFieldOption option = (NativeFieldOption) model;
      ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
      MessageField field = (MessageField) options.rootSourceOf(option);
      Enum enumType = descriptor.enumTypeOf(field);
      if (enumType != null) {
        proposeAndAccept(enumType, context, acceptor);
View Full Code Here

  //
  // message Person {
  //   optional Type type = 1 [ctype = STRING];
  // }
  @Test public void should_provide_sources_for_native_field_option() {
    NativeFieldOption option = xtext.find("ctype", NativeFieldOption.class);
    IScope scope = scopeProvider.scope_OptionSource_target(option.getSource(), reference);
    ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
    Collection<MessageField> optionSources = descriptor.optionsOfType(FIELD);
    assertThat(descriptionsIn(scope), containAll(optionSources));
  }
View Full Code Here

TOP

Related Classes of com.google.eclipse.protobuf.protobuf.NativeFieldOption

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.