public override void GetAttributeValueCompletions (CompletionDataList list, IAttributedXObject attributedOb, XAttribute att) { if (att.Name.FullName != "path") { return; } foreach (var addin in GetReferencedAddins ()) { foreach (ExtensionPoint ep in addin.Description.ExtensionPoints) { list.Add (ep.Path, null, ep.Name + "\n" + ep.Description); } } }
protected virtual Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att, CancellationToken token) { return Task.FromResult (new CompletionDataList ()); }
protected override async Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject ob, XAttribute att, CancellationToken token) { var list = new CompletionDataList (); if (ob is XElement && !ob.Name.HasPrefix) await AddHtmlAttributeValueCompletionData (list, Schema, ob.Name, att.Name, token); return list; }
protected override CompletionDataList GetAttributeValueCompletions(IAttributedXObject attributedOb, XAttribute att) { isParameterValueCompletion = true; var list = base.GetAttributeValueCompletions(attributedOb, att) ?? new CompletionDataList(); var currentPath = GetCurrentPath(); var path = GetPath(currentPath); var namespaces = GetNamespaces(currentPath); var objectName = attributedOb.Name.FullName; foreach (var completion in Completion.GetCompletions(namespaces)) { foreach (var item in completion.GetPropertyValues(objectName, att.Name.FullName, path)) { var xmlCompletion = new XmlCompletionData(item.Name, item.Description, XmlCompletionData.DataType.XmlAttributeValue); xmlCompletion.Icon = GetIcon(item.Type); list.Add(xmlCompletion); } } return list; }
protected override Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att, CancellationToken token) { var path = GetElementPath (); if (path.Elements.Count > 0) { var schema = FindSchema (path); if (schema != null) return schema.GetAttributeValueCompletionData (path, att.Name.FullName, token); } return Task.FromResult (new CompletionDataList ()); }
protected override CompletionDataList GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att) { var path = GetElementPath (); if (path.Elements.Count > 0) { var schema = FindSchema (path); if (schema != null) return schema.GetAttributeValueCompletionData (path, att.Name.FullName); } return null; }
public virtual void GetAttributeValueCompletions (CompletionDataList list, IAttributedXObject attributedOb, XAttribute att) { SchemaAttribute sca; if (attributes != null && attributes.TryGetValue (att.Name.FullName, out sca)) { sca.GetAttributeValueCompletions (list, attributedOb); } }
public override void GetAttributeValueCompletions (CompletionDataList list, IAttributedXObject attributedOb, XAttribute att) { var name = att.Name.FullName; if (name == "insertbefore" || name == "insertafter") { //TODO: conditions, children foreach (var ext in GetExtensions (proj, extensionPoint)) { foreach (ExtensionNodeDescription node in ext.ExtensionNodes) { if (!string.IsNullOrEmpty (node.Id)) { list.Add (node.Id, null, "From " + node.ParentAddinDescription.AddinId); } } } } }
protected override CompletionDataList GetAttributeValueCompletions (IAttributedXObject ob, XAttribute att) { if (ob is XElement && !ob.Name.HasPrefix) { var list = new CompletionDataList (); AddHtmlAttributeValueCompletionData (list, Schema, ob.Name, att.Name); return list; } return null; }
protected virtual CompletionDataList GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att) { return null; }
protected override CompletionDataList GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att) { XElement el; var path = GetCurrentPath (); var item = GetSchemaItem (path.Take (path.Count - 1), out el); if (item != null) { var list = new CompletionDataList (); item.GetAttributeValueCompletions (list, attributedOb, att); return list; } return null; }
protected override Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att, CancellationToken token) { XElement el; var path = GetCurrentPath (); var item = GetSchemaItem (path.Take (path.Count - 1), out el); var list = new CompletionDataList (); if (item != null) { item.GetAttributeValueCompletions (list, attributedOb, att); } return Task.FromResult (list); }
public override XmlParserState PushChar (char c, IXmlParserContext context, ref string rollback) { var att = context.Nodes.Peek () as XAttribute; //state has just been entered if (context.CurrentStateLength == 1) { if (context.PreviousState is XmlNameState) { //error parsing name if (!att.IsNamed) { context.Nodes.Pop (); rollback = string.Empty; return Parent; } context.StateTag = GETTINGEQ; } else if (context.PreviousState is XmlAttributeValueState) { //Got value, so end attribute context.Nodes.Pop (); att.End (context.LocationMinus (1)); IAttributedXObject element = (IAttributedXObject) context.Nodes.Peek (); element.Attributes.AddAttribute (att); rollback = string.Empty; return Parent; } else { //starting a new attribute Debug.Assert (att == null); Debug.Assert (context.StateTag == NAMING); att = new XAttribute (context.LocationMinus (1)); context.Nodes.Push (att); rollback = string.Empty; return XmlNameState; } } if (context.StateTag == GETTINGEQ) { if (char.IsWhiteSpace (c)) { return null; } if (c == '=') { context.StateTag = GETTINGVAL; return null; } context.LogError ("Expecting = in attribute, got '" + c + "'."); } else if (context.StateTag == GETTINGVAL) { if (char.IsWhiteSpace (c)) { return null; } rollback = string.Empty; return AttributeValueState; } else if (c != '<') { //parent handles message for '<' context.LogError ("Unexpected character '" + c + "' in attribute."); } if (att != null) context.Nodes.Pop (); rollback = string.Empty; return Parent; }