CompletionDataList GetPartialCompletionData (CodeCompletionContext ctx, IType type, string modifiers)
{
CompletionDataList result = new ProjectDomCompletionDataList ();
CompoundType partialType = dom.GetType (type.FullName) as CompoundType;
if (partialType != null) {
List<IMethod> methods = new List<IMethod> ();
// gather all partial methods without implementation
foreach (IType part in partialType.Parts) {
if (part.Location == type.Location && part.CompilationUnit.FileName == type.CompilationUnit.FileName)
continue;
foreach (IMethod method in part.Methods) {
if (method.IsPartial && method.BodyRegion.End.Line == 0 && !ContainsDeclaration (type, method)) {
methods.Add (method);
}
}
}
// now filter all methods that are implemented in the compound class
foreach (IType part in partialType.Parts) {
if (part.Location == type.Location && part.CompilationUnit.FileName == type.CompilationUnit.FileName)
continue;
for (int i = 0; i < methods.Count; i++) {
IMethod curMethod = methods[i];
IMethod method = GetDeclaration (part, curMethod);
if (method != null && method.BodyRegion.End.Line != 0) {
methods.RemoveAt (i);
i--;
continue;
}
}
}
foreach (IMethod method in methods) {
NewOverrideCompletionData data = new NewOverrideCompletionData (dom, textEditorData, ctx.TriggerOffset, type, method);
data.GenerateBody = false;
result.Add (data);
}
}
return result;
}