コード例 #1
0
        protected XmlCompletionItemCollection GetCompletionItemsForAttribute(XmlSchemaCompletion defaultSchema, XmlSchemaCompletionCollection schemas)
        {
            int    offset         = this.Position.Offset;
            string textUpToCursor = this.Text.GetText(0, offset);
            XmlCompletionItemCollection completionItems = new XmlCompletionItemCollection();

            completionItems = schemas.GetAttributeCompletion(textUpToCursor, defaultSchema);
            if (completionItems.Count == 0)
            {
                completionItems = schemas.GetElementCompletion(textUpToCursor, defaultSchema);
                if (this.HasOpenToken == false)
                {
                    completionItems.Select(i => { i.Text = "<" + i.Text; return(i); }).ToList();
                }
                completionItems.Add(new XmlCompletionItem("<?"));
                completionItems.Add(new XmlCompletionItem("<!--"));
            }

            return(completionItems);
        }