[svn] r6529: vs-plugin/trunk: Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n Nemerle....

IT svnadmin at nemerle.org
Wed Aug 16 08:31:28 CEST 2006


Log:
Working on xml doc comments.

Author: IT
Date: Wed Aug 16 08:31:23 2006
New Revision: 6529

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n
   vs-plugin/trunk/Nemerle.VSIP.suo
   vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n	Wed Aug 16 08:31:23 2006
@@ -1,4 +1,6 @@
 using System;
+using System.IO;
+using System.Xml;
 
 using Nemerle.Utility;
 using Nemerle.Compiler;
@@ -122,7 +124,7 @@
       when (value.IsMutable)
         kind = "mutable " + kind;
 
-      return kind;
+      kind
     }
 
     private GetAttributeText(attrs : NemerleAttributes) : string
@@ -151,14 +153,73 @@
       | CompilerMutable = 0x40000 // field is immutable, but compiler overrides it and can assign something
       */
 
-      return s;
+      s
+    }
+
+    private GetDocText(location : Location) : string
+    {
+      ret :
+      {
+        when (!string.IsNullOrEmpty(location.File) && location.EndLine == 0)
+        {
+          def name = Path.ChangeExtension(location.File, ".xml");
+
+          when (File.Exists(name))
+          {
+            using (xml = XmlReader.Create(name))
+            {
+              _ = xml.MoveToContent();
+
+              while (xml.Read())
+              {
+                match (xml.NodeType)
+                {
+                | XmlNodeType.Element =>
+
+                  when (xml.Name == "member" &&
+                        xml.MoveToAttribute("name") &&
+                        xml.Value == "T:System.String")
+                  {
+                    def getText()
+                    {
+                      ret :
+                      {
+                        while (xml.Read()) match (xml.NodeType)
+                        {
+                        | XmlNodeType.Text       => ret(xml.Value)
+                        | XmlNodeType.EndElement => ret("")
+                        | _ => ()
+                        }
+                        ""
+                      }
+                    }
+
+                    mutable summary = "";
+
+                    while (xml.Read()) match (xml.NodeType)
+                    {
+                    | XmlNodeType.Element    when xml.Name == "summary" => summary = getText()
+                    | XmlNodeType.EndElement when xml.Name == "member"  => ret("\n" + summary);
+                    | _ => ()
+                    }
+                  }
+
+                | _ => ()
+                }
+              }
+            }
+          }
+        }
+
+        ""
+      }
     }
 
     private GetLocationText(location : Location) : string
     {
       if (string.IsNullOrEmpty(location.File))
         ""
-      else if (location.Line == 0)
+      else if (location.EndLine == 0)
         "\n\n" + location.File
       else
         "\n\n" + location.ToString();
@@ -240,7 +301,7 @@
         | Enum          => "enum"
         }
 
-        _text += " " + tycon.FullName + GetLocationText(tycon.Location);
+        _text += " " + tycon.FullName + GetDocText(tycon.Location) + GetLocationText(tycon.Location);
 
       | _ => _text += mtype.ToString()
       }

Modified: vs-plugin/trunk/Nemerle.VSIP.suo
==============================================================================
Binary files. No diff available.

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs	Wed Aug 16 08:31:23 2006
@@ -156,8 +156,8 @@
 			}
 			catch (Exception ex)
 			{
-				// Îäčí č ňîň ćĺ ôŕéë ěîćĺň âőîäčňü â đŕçíűĺ ďđîĺęňű.
-				//VladD2: Ďîęŕ çŕáčâŕĺě íŕ íĺńęîëüęî ďđîĺęňîâ. 
+				// Same file can be included in different projects.
+				// VladD2: For now we don't support it. 
 				const string format = "Error add file '{0}' to Complation Engine.\r\n{1}";
 				Debug.WriteLine(string.Format(format, path, ex));
 			}



More information about the svn mailing list