public IEnumerable<CompletionData> SelfDotCompletionData (PythonClass klass) { foreach (var attr in klass.Attributes) yield return new CompletionData (attr.Name, s_ImgAttr, attr.Documentation); foreach (var func in klass.Functions) yield return new CompletionData (func.Name, s_ImgFunc, func.Documentation); }
void BuildAttribute(XmlElement element, PythonClass pyClass) { pyClass.Attributes.Add(new PythonAttribute() { Name = element.GetAttribute("name"), Region = GetDomRegion(element) }); }
IEnumerable <FoldingRegion> GenerateFunctionFolds(PythonClass pyClass) { if (Module == null) { yield break; } foreach (PythonFunction pyFunc in pyClass.Functions) { yield return(new FoldingRegion(pyFunc.Region)); // TODO: Look for inner classes } }
void BuildFunction(XmlElement element, PythonClass pyClass) { PythonFunction pyFunc; pyClass.Functions.Add(pyFunc = new PythonFunction() { Name = element.GetAttribute("name"), Region = GetDomRegion(element), }); foreach (XmlElement child in element) { if (child.LocalName == "doc") { pyFunc.Documentation = element.InnerText.Trim(); } else if (child.LocalName == "argument") { BuildArgument(child, pyFunc); } } }
void BuildClass(XmlElement element) { PythonClass pyClass; Module.Classes.Add(pyClass = new PythonClass() { Name = element.GetAttribute("name"), Region = GetDomRegion(element) }); // PythonClasses can have Attributes or Functions directly // inside them. They can also have doc elements which we // we can set. foreach (XmlElement child in element) { switch (child.LocalName) { case "doc": pyClass.Documentation = child.InnerText; break; case "attribute": BuildAttribute(child, pyClass); break; case "function": BuildFunction(child, pyClass); break; default: Debug.Assert(false, "Assert not reached"); break; } } }
IEnumerable<FoldingRegion> GenerateFunctionFolds (PythonClass pyClass) { if (Module == null) yield break; foreach (PythonFunction pyFunc in pyClass.Functions) { yield return new FoldingRegion (pyFunc.Region); // TODO: Look for inner classes } }
void BuildClass (XmlElement element) { PythonClass pyClass; Module.Classes.Add (pyClass = new PythonClass () { Name = element.GetAttribute ("name"), Region = GetDomRegion (element) }); // PythonClasses can have Attributes or Functions directly // inside them. They can also have doc elements which we // we can set. foreach (XmlElement child in element) { switch (child.LocalName) { case "doc": pyClass.Documentation = child.InnerText; break; case "attribute": BuildAttribute (child, pyClass); break; case "function": BuildFunction (child, pyClass); break; default: Debug.Assert (false, "Assert not reached"); break; } } }
void BuildFunction (XmlElement element, PythonClass pyClass) { PythonFunction pyFunc; pyClass.Functions.Add (pyFunc = new PythonFunction () { Name = element.GetAttribute ("name"), Region = GetDomRegion (element), }); foreach (XmlElement child in element) if (child.LocalName == "doc") pyFunc.Documentation = element.InnerText.Trim (); else if (child.LocalName == "argument") BuildArgument (child, pyFunc); }
void BuildAttribute (XmlElement element, PythonClass pyClass) { pyClass.Attributes.Add (new PythonAttribute () { Name = element.GetAttribute ("name"), Region = GetDomRegion (element) }); }