public XmlCompletionItemCollection GetAttributeValueCompletion(char charTyped, string textUpToCursor, XmlSchemaCompletion defaultSchema) { if (XmlParser.IsAttributeValueChar(charTyped)) { var attributeName = XmlParser.GetAttributeName(textUpToCursor, textUpToCursor.Length); if (attributeName.Length > 0) { var elementPath = XmlParser.GetActiveElementStartPath(textUpToCursor, textUpToCursor.Length); return(GetAttributeValueCompletion(elementPath, attributeName, defaultSchema)); } } return(new XmlCompletionItemCollection()); }
public XmlCompletionItemCollection GetAttributeCompletion(string textUpToCursor, XmlSchemaCompletion defaultSchema) { if (!XmlParser.IsInsideAttributeValue(textUpToCursor, textUpToCursor.Length)) { var path = XmlParser.GetActiveElementStartPath(textUpToCursor, textUpToCursor.Length); path.Compact(); if (path.Elements.HasItems) { return(GetAttributeCompletion(path, defaultSchema)); } } return(new XmlCompletionItemCollection()); }