public void AddAttributeValue(string valueText, XmlSchemaAnnotation annotation) { var item = new CompletionItem(valueText, source, XmlImages.AttributeValue); item.AddDocumentation(annotation); items.Add(item); }
CompletionItem CreateSpecialItem(string text, string description, KnownImages image, MSBuildSpecialCommitKind kind) { var item = new CompletionItem(text, this, provider.DisplayElementFactory.GetImageElement(image)); item.Properties.AddProperty(typeof(MSBuildSpecialCommitKind), kind); item.AddDocumentation(description); return(item); }
CompletionItem CreateSdkCompletionItem(SdkInfo info) { var img = provider.DisplayElementFactory.GetImageElement(KnownImages.Sdk); var item = new CompletionItem(info.Name, this, img); //FIXME better tooltips for SDKs item.AddDocumentation(info.Path); return(item); }
/// <summary> /// Adds an element completion data to the collection if it does not /// already exist. /// </summary> public void AddElement(string name, string prefix, XmlSchemaAnnotation annotation) { if (!names.Add(name)) { return; } //FIXME: don't accept a prefix, accept a namespace and resolve it to a prefix if (prefix.Length > 0) { name = string.Concat(prefix, ":", name); } var item = new CompletionItem(name, source, XmlImages.Element); item.AddDocumentation(annotation); items.Add(item); }
public void AddAttribute(XmlSchemaAttribute attribute) { string name = attribute.Name; if (name == null) { var ns = attribute.RefName.Namespace; if (string.IsNullOrEmpty(ns)) { return; } var prefix = nsMap.GetPrefix(ns); if (prefix == null) { if (ns == "http://www.w3.org/XML/1998/namespace") { prefix = "xml"; } else { return; } } name = attribute.RefName.Name; if (prefix.Length > 0) { name = prefix + ":" + name; } } if (!names.Add(name)) { return; } var item = new CompletionItem(name, source, XmlImages.Attribute); item.AddDocumentation(attribute.Annotation); items.Add(item); }