+
+ public class CompletionElementInitializer : CompletingExpression {
+ string partial_name;
+
+ public CompletionElementInitializer (string partial_name, Location l)
+ {
+ this.partial_name = partial_name;
+ this.loc = l;
+ }
+
+ protected override Expression DoResolve (ResolveContext ec)
+ {
+ var members = MemberCache.GetCompletitionMembers (ec.CurrentInitializerVariable.Type, partial_name);
+
+// TODO: Does this mean exact match only ?
+// if (partial_name != null && results.Count > 0 && result [0] == "")
+// throw new CompletionResult ("", new string [] { "=" });
+
+ var results = members.Where (l => (l.Kind & (MemberKind.Field | MemberKind.Property)) != 0).Select (l => l.Name).ToList ();
+ if (partial_name != null) {
+ var temp = new List<string> ();
+ AppendResults (temp, partial_name, results);
+ results = temp;
+ }
+
+ throw new CompletionResult (partial_name == null ? "" : partial_name, results.Distinct ().ToArray ());
+ }
+
+ protected override void CloneTo (CloneContext clonectx, Expression t)
+ {
+ // Nothing
+ }
+ }
+
+}