コード例 #1
0
		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);
		}
コード例 #2
0
 void BuildAttribute(XmlElement element, PythonClass pyClass)
 {
     pyClass.Attributes.Add(new PythonAttribute()
     {
         Name   = element.GetAttribute("name"),
         Region = GetDomRegion(element)
     });
 }
コード例 #3
0
        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
            }
        }
コード例 #4
0
        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);
                }
            }
        }
コード例 #5
0
        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;
                }
            }
        }
コード例 #6
0
		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
			}
		}
コード例 #7
0
		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;
				}
			}
		}
コード例 #8
0
		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);
		}
コード例 #9
0
		void BuildAttribute (XmlElement element, PythonClass pyClass)
		{
			pyClass.Attributes.Add (new PythonAttribute () {
				Name   = element.GetAttribute ("name"),
				Region = GetDomRegion (element)
			});
		}