Fixed: [Issue 155] Editor does not support complex custom options.

Working on content assist.
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/contentassist/ProtobufProposalProvider.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/contentassist/ProtobufProposalProvider.java
index 36f8d22..3ad7e96 100644
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/contentassist/ProtobufProposalProvider.java
+++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/contentassist/ProtobufProposalProvider.java
@@ -15,8 +15,7 @@
 import static java.lang.String.valueOf;
 import static java.util.Collections.*;
 import static org.eclipse.xtext.EcoreUtil2.getAllContentsOfType;
-import static org.eclipse.xtext.nodemodel.util.NodeModelUtils.findActualSemanticObjectFor;
-import static org.eclipse.xtext.util.Strings.toFirstLower;
+import static org.eclipse.xtext.util.Strings.*;
 
 import java.util.*;
 
@@ -48,6 +47,7 @@
  */
 public class ProtobufProposalProvider extends AbstractProtobufProposalProvider {
 
+
   @Inject private IEObjectDescriptionChooser descriptionChooser;
   @Inject private ProtoDescriptorProvider descriptorProvider;
   @Inject private FieldOptions fieldOptions;
@@ -385,7 +385,7 @@
     }
     if (field == null) return;
     if (!properties.isOptional(field)) return;
-    proposeDefaultValue(field, context, acceptor);
+    proposeFieldValue(field, context, acceptor);
   }
 
   @Override public void completeNativeFieldOption_Value(EObject model, Assignment assignment,
@@ -467,76 +467,56 @@
     return imageHelper.getImage(images.imageFor(Option.class));
   }
 
-  @Override public void completeCustomOption_Fields(EObject model, Assignment assignment,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
-
-  @Override public void completeCustomFieldOption_Fields(EObject model, Assignment assignment,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
-
-  @Override public void completeOptionSource_Target(EObject model, Assignment assignment,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
-
-  @Override public void completeMessageOptionField_Target(EObject model, Assignment assignment,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
-
-  @Override public void completeExtensionOptionField_Target(EObject model, Assignment assignment,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
-
-  @Override public void complete_MessageOptionField(EObject model, RuleCall ruleCall,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
-    EObject e = findActualSemanticObjectFor(context.getCurrentNode());
-    if (e instanceof Protobuf) e = model;
-    Collection<IEObjectDescription> scope = emptySet();
-    if (e instanceof CustomOption) {
-      CustomOption option = (CustomOption) e;
-      scope = scoping().allPossibleSourcesOfFieldOf(option);
-    }
-    if (e instanceof CustomFieldOption) {
-      CustomFieldOption option = (CustomFieldOption) e;
-      scope = scoping().allPossibleSourcesOfFieldOf(option);
-    }
-    if (e instanceof MessageOptionField) {
-      MessageOptionField field = (MessageOptionField) e;
-      scope = scoping().allPossibleSourcesOf(field);
-    }
-    for (IEObjectDescription d : descriptionChooser.shortestQualifiedNamesIn(scope)) {
-      Image image = imageHelper.getImage(images.imageFor(d.getEObjectOrProxy()));
-      proposeAndAccept(d, image, context, acceptor);
-    }
-  }
-
-  // TODO fix parenthesis
-  @Override public void complete_ExtensionOptionField(EObject model, RuleCall ruleCall,
-      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
-    EObject e = findActualSemanticObjectFor(context.getCurrentNode());
-    if (e instanceof Protobuf) e = model;
-    Collection<IEObjectDescription> scope = emptySet();
-    if (e instanceof CustomOption) {
-      CustomOption option = (CustomOption) e;
-      scope = scoping().allPossibleSourcesOfFieldOf(option);
-    }
-    if (e instanceof CustomFieldOption) {
-      CustomFieldOption option = (CustomFieldOption) e;
-      scope = scoping().allPossibleSourcesOfFieldOf(option);
-    }
-    if (e instanceof ExtensionOptionField) {
-      ExtensionOptionField field = (ExtensionOptionField) e;
-      scope = scoping().allPossibleSourcesOf(field);
-    }
-    for (IEObjectDescription d : descriptionChooser.shortestQualifiedNamesIn(scope)) {
-      Image image = imageHelper.getImage(images.imageFor(d.getEObjectOrProxy()));
-      proposeAndAccept(d, image, context, acceptor);
-    }
-  }
-
   private void proposeAndAccept(IEObjectDescription d, Image image, ContentAssistContext context,
       ICompletionProposalAcceptor acceptor) {
-    QualifiedName name = d.getName();
-    String display = name.getLastSegment()  + " - " + name.toString();
-    ICompletionProposal proposal = createCompletionProposal(name.toString(), display, image, context);
-    acceptor.accept(proposal);
+    proposeAndAccept(d, null, null, image, context, acceptor);
   }
 
+  @Override public void completeCustomOption_Fields(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+    if (!(model instanceof CustomOption)) return;
+    CustomOption option = (CustomOption) model;
+    proposeAndAccept(scoping().allPossibleNormalFieldsOf(option), context, acceptor);
+    proposeAndAccept(scoping().allPossibleExtensionFieldsOf(option), "(%s)", "(%s)", context, acceptor);
+  }
+
+  @Override public void completeCustomFieldOption_Fields(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+    if (!(model instanceof CustomFieldOption)) return;
+    CustomFieldOption option = (CustomFieldOption) model;
+    proposeAndAccept(scoping().allPossibleNormalFieldsOf(option), context, acceptor);
+    proposeExtensionFields(scoping().allPossibleExtensionFieldsOf(option), context, acceptor);
+  }
+  
+  private void proposeExtensionFields(Collection<IEObjectDescription> scope, ContentAssistContext context,
+      ICompletionProposalAcceptor acceptor) {
+    String format = "(%s)";
+    proposeAndAccept(scope, format, format, context, acceptor);
+  }
+
+  private void proposeAndAccept(Collection<IEObjectDescription> scope, ContentAssistContext context,
+      ICompletionProposalAcceptor acceptor) {
+    proposeAndAccept(scope, null, null, context, acceptor);
+  }
+
+  @Override public void completeOptionSource_Target(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+  }
+
+  @Override public void completeMessageOptionField_Target(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+  }
+
+  @Override public void completeExtensionOptionField_Target(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+  }
+
+  @Override public void complete_MessageOptionField(EObject model, RuleCall ruleCall,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
+
+  @Override public void complete_ExtensionOptionField(EObject model, RuleCall ruleCall,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {}
+
   @Override public void completeCustomOption_Value(EObject model, Assignment assignment, ContentAssistContext context,
       ICompletionProposalAcceptor acceptor) {
     if (!(model instanceof CustomOption)) return;
@@ -544,7 +524,7 @@
     IndexedElement e = options.lastFieldSourceFrom(option);
     if (e == null) e = options.rootSourceOf(option);
     if (e instanceof MessageField) {
-      proposeDefaultValue((MessageField) e, context, acceptor);
+      proposeFieldValue((MessageField) e, context, acceptor);
     }
   }
 
@@ -556,11 +536,11 @@
     IndexedElement e = fieldOptions.sourceOfLastFieldIn(option);
     if (e == null) e = fieldOptions.rootSourceOf(option);
     if (e instanceof MessageField) {
-      proposeDefaultValue((MessageField) e, context, acceptor);
+      proposeFieldValue((MessageField) e, context, acceptor);
     }
   }
 
-  private void proposeDefaultValue(MessageField field, ContentAssistContext context,
+  private void proposeFieldValue(MessageField field, ContentAssistContext context,
       ICompletionProposalAcceptor acceptor) {
     if (field == null) return;
     if (proposePrimitiveValues(field, context, acceptor)) return;
@@ -569,13 +549,53 @@
       proposeAndAccept(enumType, context, acceptor);
     }
   }
-
+  
   private void proposeAndAccept(Enum enumType, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
     Image image = imageHelper.getImage(images.imageFor(Literal.class));
     for (Literal literal : getAllContentsOfType(enumType, Literal.class))
       proposeAndAccept(literal.getName(), image, context, acceptor);
   }
 
+  @Override public void completeNormalFieldName_Target(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+  }
+
+  @Override public void completeExtensionFieldName_Target(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+  }
+
+  @Override public void completeSimpleValueField_Name(EObject model, Assignment assignment,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+    if (!(model instanceof ComplexValue)) return;
+    ComplexValue value = (ComplexValue) model;
+    proposeAndAccept(scoping().allPossibleNamesOfNormalFieldsOf(value), "%s:", null, context, acceptor);
+    proposeAndAccept(scoping().allPossibleNamesOfExtensionFieldsOf(value), "[%s]:", "[%s]", context, acceptor);
+  }
+
+  private void proposeAndAccept(Collection<IEObjectDescription> scope, String proposalFormat, String displayFormat,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+    for (IEObjectDescription d : descriptionChooser.shortestQualifiedNamesIn(scope)) {
+      Image image = imageHelper.getImage(images.imageFor(d.getEObjectOrProxy()));
+      proposeAndAccept(d, proposalFormat, displayFormat, image, context, acceptor);
+    }
+  }
+
+  private void proposeAndAccept(IEObjectDescription d, String proposalFormat, String displayFormat, Image image,
+      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
+    QualifiedName name = d.getName();
+    String proposalText = name.toString();
+    if (!isEmpty(proposalFormat)) {
+      proposalText = String.format(proposalFormat, proposalText);
+    }
+    String lastSegment = name.getLastSegment();
+    if (!isEmpty(displayFormat)) {
+      lastSegment = String.format(displayFormat, lastSegment);
+    }
+    String display = String.format("%s - %s", lastSegment, name.toString());
+    ICompletionProposal proposal = createCompletionProposal(proposalText, display, image, context);
+    acceptor.accept(proposal);
+  }
+
   private void proposeAndAccept(String proposalText, Image image, ContentAssistContext context,
       ICompletionProposalAcceptor acceptor) {
     ICompletionProposal proposal = createCompletionProposal(proposalText, proposalText, image, context);
@@ -590,7 +610,8 @@
       ContentAssistContext contentAssistContext) {
     StyledString styled = null;
     if (displayString != null) styled = new StyledString(displayString);
-    return createCompletionProposal(proposal, styled, image, getPriorityHelper().getDefaultPriority(), 
-        contentAssistContext.getPrefix(), contentAssistContext);
+    int priority = getPriorityHelper().getDefaultPriority();
+    String prefix = contentAssistContext.getPrefix();
+    return createCompletionProposal(proposal, styled, image, priority, prefix, contentAssistContext);
   }
 }
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
index 1299e78..d455e5d 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
@@ -155,13 +155,13 @@
   target=[IndexedElement|QualifiedName];
 
 OptionField:
-  MessageOptionField | ExtensionOptionField;
+  MessageOptionField | '(' ExtensionOptionField ')';
 
 MessageOptionField:
   target=[IndexedElement];  
 
 ExtensionOptionField:
-  '(' target=[IndexedElement|QualifiedName] ')';  
+  target=[IndexedElement|QualifiedName];
 
 IndexedElement:
   =>MessageField | Group;
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/CustomOptionFieldScopeFinder.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/CustomOptionFieldScopeFinder.java
index 7140cb1..e128e33 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/CustomOptionFieldScopeFinder.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/CustomOptionFieldScopeFinder.java
@@ -31,8 +31,12 @@
   @Inject private Options options;
   @Inject private QualifiedNameDescriptions qualifiedNameDescriptions;
 
-  Collection<IEObjectDescription> findScope(CustomOption option, OptionField field) {
-    return findScope(option, field, descriptionsProvider(field));
+  Collection<IEObjectDescription> findScope(CustomOption option, MessageOptionField field) {
+    return findScope(option, field, new MessageFieldDescriptorProvider());
+  }
+
+  Collection<IEObjectDescription> findScope(CustomOption option, ExtensionOptionField field) {
+    return findScope(option, field, new ExtensionFieldDescriptorProvider());
   }
 
   private Collection<IEObjectDescription> findScope(final CustomOption option, OptionField field,
@@ -46,13 +50,12 @@
     return emptySet();
   }
 
-  Collection<IEObjectDescription> findScope(CustomFieldOption option, OptionField field) {
-    return findScope(option, field, descriptionsProvider(field));
+  Collection<IEObjectDescription> findScope(CustomFieldOption option, MessageOptionField field) {
+    return findScope(option, field, new MessageFieldDescriptorProvider());
   }
-  
-  private IEObjectDescriptionsProvider descriptionsProvider(OptionField field) {
-    if (field instanceof MessageOptionField) return new MessageFieldDescriptorProvider();
-    return new ExtensionFieldDescriptorProvider();
+
+  Collection<IEObjectDescription> findScope(CustomFieldOption option, ExtensionOptionField field) {
+    return findScope(option, field, new ExtensionFieldDescriptorProvider());
   }
 
   private Collection<IEObjectDescription> findScope(final CustomFieldOption option, OptionField field,
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/FieldNotationScopeFinder.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/FieldNotationScopeFinder.java
index 3e38f54..39270d8 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/FieldNotationScopeFinder.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/FieldNotationScopeFinder.java
@@ -30,35 +30,34 @@
   @Inject private ModelFinder modelFinder;
   @Inject private QualifiedNameDescriptions qualifiedNameDescriptions;
 
-  Collection<IEObjectDescription> sourceOf(FieldName name) {
-    EObject container = name.eContainer();
-    if (!(container instanceof ValueField)) return emptySet();
-    MessageField field = sourceOf((ValueField) container);
-    if (field == null) return emptySet();
-    if (name instanceof NormalFieldName) {
-      return propertiesInTypeOf(field);
-    }
-    return propertiesInExtendMessageOf(field);
+  Collection<IEObjectDescription> sourceOfNormalFieldNamesOf(ComplexValue value) {
+    MessageField source = sourceOf(value);
+    if (source == null) return emptySet();
+    return propertiesInTypeOf(source);
   }
-  
-  private MessageField sourceOf(ValueField field) {
-    EObject container = field.eContainer();
+
+  Collection<IEObjectDescription> sourceOfExtensionFieldNamesOf(ComplexValue value) {
+    MessageField source = sourceOf(value);
+    if (source == null) return emptySet();
+    return propertiesInExtendMessageOf(source);
+  }
+
+  private MessageField sourceOf(ComplexValue value) {
     IndexedElement source = null;
-    if (container instanceof ComplexValue) {
-      container = container.eContainer();
-      if (container instanceof CustomOption) {
-        CustomOption option = (CustomOption) container;
-        source = options.sourceOf(option);
-      }
-      if (container instanceof CustomFieldOption) {
-        CustomFieldOption option = (CustomFieldOption) container;
-        source = fieldOptions.sourceOf(option);
-      }
-      if (container instanceof ComplexValueField) {
-        return sourceOf((ComplexValueField) container);
-      }
+    EObject container = value.eContainer();
+    if (container instanceof CustomOption) {
+      CustomOption option = (CustomOption) container;
+      source = options.sourceOf(option);
     }
-    return ((source instanceof MessageField) ? (MessageField) source : null);
+    if (container instanceof CustomFieldOption) {
+      CustomFieldOption option = (CustomFieldOption) container;
+      source = fieldOptions.sourceOf(option);
+    }
+    if (container instanceof ComplexValueField) {
+      source = sourceOf((ComplexValueField) container);
+    }
+    if (source instanceof MessageField) return (MessageField) source;
+    return null;
   }
 
   private MessageField sourceOf(ComplexValueField field) {
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
index 0450f8b..7cad285 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider.java
@@ -55,7 +55,7 @@
     Set<IEObjectDescription> descriptions = emptySet();
     return createScope(descriptions);
   }
-  
+
   @Override public Collection<IEObjectDescription> allPossibleTypesFor(MessageField field) {
     return astWalker.traverseAst(field, typeScopeFinder, ComplexType.class);
   }
@@ -112,7 +112,7 @@
     }
     return createScope(literalDescriptions.literalsOf(anEnum));
   }
-  
+
   @SuppressWarnings("unused")
   public IScope scope_OptionSource_target(OptionSource source, EReference r) {
     EObject c = source.eContainer();
@@ -135,7 +135,7 @@
     Set<IEObjectDescription> descriptions = emptySet();
     return createScope(descriptions);
   }
-  
+
   @Override public Collection<IEObjectDescription> allPossibleSourcesOf(CustomOption option) {
     OptionType optionType = typeOf(option);
     Collection<IEObjectDescription> descriptions = emptySet();
@@ -158,43 +158,92 @@
   public IScope scope_OptionField_target(OptionField field, EReference r) {
     return createScope(allPossibleSourcesOf(field));
   }
-  
-  @Override public Collection<IEObjectDescription> allPossibleSourcesOf(OptionField field) {
+
+  private Collection<IEObjectDescription> allPossibleSourcesOf(OptionField field) {
+    if (field == null) return emptySet();
     EObject container = field.eContainer();
     if (container instanceof CustomOption) {
-      return findSources((CustomOption) container, field);
+      CustomOption option = (CustomOption) container;
+      if (field instanceof MessageOptionField) {
+        return findSources(option, (MessageOptionField) field);
+      }
+      return findSources(option, (ExtensionOptionField) field);
     }
     if (container instanceof CustomFieldOption) {
-      return findSources((CustomFieldOption) container, field);
+      CustomFieldOption option = (CustomFieldOption) container;
+      if (field instanceof MessageOptionField) {
+        return findSources(option, (MessageOptionField) field);
+      }
+      return findSources(option, (ExtensionOptionField) field);
     }
     return emptySet();
   }
-  
-  @Override public Collection<IEObjectDescription> allPossibleSourcesOfFieldOf(CustomOption option) {
+
+  @Override public Collection<IEObjectDescription> allPossibleNormalFieldsOf(CustomOption option) {
     return findSources(option, (MessageOptionField) null);
   }
 
-  @Override public Collection<IEObjectDescription> allPossibleSourcesOfFieldOf(CustomFieldOption option) {
+  @Override public Collection<IEObjectDescription> allPossibleNormalFieldsOf(CustomFieldOption option) {
     return findSources(option, (MessageOptionField) null);
   }
-
-  private Collection<IEObjectDescription> findSources(CustomOption option,OptionField field) {
-    return customOptionFieldScopeFinder.findScope(option, field);
-  }
-
-  private Collection<IEObjectDescription> findSources(CustomFieldOption option, OptionField field) {
-    return customOptionFieldScopeFinder.findScope(option, field);
-  }
   
+  @Override public Collection<IEObjectDescription> allPossibleExtensionFieldsOf(CustomOption option) {
+    return findSources(option, (ExtensionOptionField) null);
+  }
+
+  @Override public Collection<IEObjectDescription> allPossibleExtensionFieldsOf(CustomFieldOption option) {
+    return findSources(option, (ExtensionOptionField) null);
+  }
+
+  private Collection<IEObjectDescription> findSources(CustomOption option, MessageOptionField field) {
+    return customOptionFieldScopeFinder.findScope(option, field);
+  }
+
+  private Collection<IEObjectDescription> findSources(CustomOption option, ExtensionOptionField field) {
+    return customOptionFieldScopeFinder.findScope(option, field);
+  }
+
+  private Collection<IEObjectDescription> findSources(CustomFieldOption option, MessageOptionField field) {
+    return customOptionFieldScopeFinder.findScope(option, field);
+  }
+
+  private Collection<IEObjectDescription> findSources(CustomFieldOption option, ExtensionOptionField field) {
+    return customOptionFieldScopeFinder.findScope(option, field);
+  }
+
   @SuppressWarnings("unused") 
   public IScope scope_FieldName_target(FieldName name, EReference r) {
-    return findScope(name);
+    return createScope(findSources(name));
   }
 
-  private IScope findScope(FieldName name) {
-    return createScope(fieldNotationScopeFinder.sourceOf(name));
+  private Collection<IEObjectDescription> findSources(FieldName name) {
+    ComplexValue value = container(name);
+    if (value == null) return emptySet();
+    if (name instanceof NormalFieldName) {
+      return allPossibleNamesOfNormalFieldsOf(value);
+    }
+    return allPossibleNamesOfExtensionFieldsOf(value);
   }
-  
+
+  private ComplexValue container(FieldName name) {
+    EObject container = name;
+    while (container != null) {
+      if (container instanceof ComplexValue) {
+        return (ComplexValue) container;
+      }
+      container = container.eContainer();
+    }
+    return null;
+  }
+
+  @Override public Collection<IEObjectDescription> allPossibleNamesOfNormalFieldsOf(ComplexValue value) {
+    return fieldNotationScopeFinder.sourceOfNormalFieldNamesOf(value);
+  }
+
+  @Override public Collection<IEObjectDescription> allPossibleNamesOfExtensionFieldsOf(ComplexValue value) {
+    return fieldNotationScopeFinder.sourceOfExtensionFieldNamesOf(value);
+  }
+
   private static IScope createScope(Iterable<IEObjectDescription> descriptions) {
     return new SimpleScope(descriptions, DO_NOT_IGNORE_CASE);
   }
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/Scoping.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/Scoping.java
index 5d5df0c..9f9c425 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/Scoping.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/Scoping.java
@@ -18,20 +18,26 @@
  * @author alruiz@google.com (Alex Ruiz)
  */
 public interface Scoping {
-  
+
+  Collection<IEObjectDescription> allPossibleTypesFor(MessageField field);
+
   Collection<IEObjectDescription> allPossibleMessagesFor(MessageExtension extension);
-  
+
   Collection<IEObjectDescription> allPossibleMessagesFor(Rpc rpc);
-  
+
   Collection<IEObjectDescription> allPossibleSourcesOf(CustomOption option);
 
   Collection<IEObjectDescription> allPossibleSourcesOf(CustomFieldOption option);
 
-  Collection<IEObjectDescription> allPossibleSourcesOf(OptionField field);
-  
-  Collection<IEObjectDescription> allPossibleSourcesOfFieldOf(CustomOption option);
-  
-  Collection<IEObjectDescription> allPossibleSourcesOfFieldOf(CustomFieldOption option);
+  Collection<IEObjectDescription> allPossibleNormalFieldsOf(CustomOption option);
 
-  Collection<IEObjectDescription> allPossibleTypesFor(MessageField field);
+  Collection<IEObjectDescription> allPossibleNormalFieldsOf(CustomFieldOption option);
+
+  Collection<IEObjectDescription> allPossibleExtensionFieldsOf(CustomOption option);
+
+  Collection<IEObjectDescription> allPossibleExtensionFieldsOf(CustomFieldOption option);
+
+  Collection<IEObjectDescription> allPossibleNamesOfNormalFieldsOf(ComplexValue value);
+
+  Collection<IEObjectDescription> allPossibleNamesOfExtensionFieldsOf(ComplexValue value);
 }