protected override void GetElementCompletions(CompletionDataList list) { var path = GetElementPath(); if (path.Elements.Count > 0) { IXmlCompletionProvider schema = FindSchema(path); if (schema == null) { schema = inferredCompletionData; } if (schema != null) { var completionData = schema.GetChildElementCompletionData(path); if (completionData != null) { list.AddRange(completionData); } } } else if (defaultSchemaCompletionData != null) { list.AddRange(defaultSchemaCompletionData.GetElementCompletionData(defaultNamespacePrefix)); } else if (inferredCompletionData != null) { list.AddRange(inferredCompletionData.GetElementCompletionData()); } AddMiscBeginTags(list); }
protected override async Task <CompletionDataList> GetElementCompletions(CancellationToken token) { var list = new CompletionDataList(); var path = GetElementPath(); if (path.Elements.Count > 0) { IXmlCompletionProvider schema = FindSchema(path); if (schema == null) { schema = inferredCompletionData; } if (schema != null) { var completionData = await schema.GetChildElementCompletionData(path, token); if (completionData != null) { list.AddRange(completionData); } } } else if (defaultSchemaCompletionData != null) { list.AddRange(await defaultSchemaCompletionData.GetElementCompletionData(defaultNamespacePrefix, token)); } else if (inferredCompletionData != null) { list.AddRange(await inferredCompletionData.GetElementCompletionData(token)); } AddMiscBeginTags(list); return(list); }