Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Created August 24, 2010 13:14
Show Gist options
  • Save jonpryor/547533 to your computer and use it in GitHub Desktop.
Save jonpryor/547533 to your computer and use it in GitHub Desktop.
diff --git a/mcs/mcs/doc.cs b/mcs/mcs/doc.cs
index 7107568..2b8ed2c 100644
--- a/mcs/mcs/doc.cs
+++ b/mcs/mcs/doc.cs
@@ -720,8 +720,16 @@ namespace Mono.CSharp {
if (paramSpec.Length > 0)
paramSpec += ")";
- string name = mc is Constructor ? "#ctor" : mc.Name;
- if (mc.MemberName.IsGeneric)
+ string name = mc.Name;
+ if (mc is Constructor)
+ name = "#ctor";
+ else if (mc is InterfaceMemberBase) {
+ var imb = (InterfaceMemberBase) mc;
+ name = imb.GetFullName (imb.ShortName);
+ }
+ name = name.Replace ('.', '#');
+
+ if (mc.MemberName.TypeArguments != null && mc.MemberName.TypeArguments.Count > 0)
name += "``" + mc.MemberName.CountTypeArguments;
string suffix = String.Empty;
diff --git a/mcs/mcs/property.cs b/mcs/mcs/property.cs
index c0e4b78..9ce7aab 100644
--- a/mcs/mcs/property.cs
+++ b/mcs/mcs/property.cs
@@ -799,6 +799,11 @@ namespace Mono.CSharp
base.Emit ();
}
+
+ public override string GetDocCommentName (DeclSpace ds)
+ {
+ return String.Concat (DocCommentHeader, ds.Name, ".", GetFullName (ShortName).Replace ('.', '#'));
+ }
}
/// <summary>
diff --git a/mcs/tests/test-xml-054-ref.xml b/mcs/tests/test-xml-054-ref.xml
new file mode 100644
index 0000000..8bfa02a
--- /dev/null
+++ b/mcs/tests/test-xml-054-ref.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>test-xml-054</name>
+ </assembly>
+ <members>
+ <member name="T:Container`2">
+ <summary>T:Container`2</summary>
+ </member>
+ <member name="M:Container`2.#ctor">
+ <summary>M:Container`2.#ctor</summary>
+ </member>
+ <member name="T:Container`2.Element">
+ <summary>T:Container`2.Element</summary>
+ </member>
+ <member name="M:Container`2.Element.System#ICloneable#Clone">
+ <summary>M:Container`2.Element.System#ICloneable#Clone</summary>
+ </member>
+ <member name="M:Container`2.Element.Clone">
+ <summary>M:Container`2.Element.Clone</summary>
+ </member>
+ <member name="P:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#Item(System.Int32)">
+ <summary>P:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#Item(System.Int32)</summary>
+ </member>
+ <member name="P:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#IsReadOnly">
+ <summary>P:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#IsReadOnly</summary>
+ </member>
+ <member name="P:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Count">
+ <summary>P:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Count</summary>
+ </member>
+ <member name="M:Container`2.A#I#Bar``1(``0)">
+ <summary>T:Container`2.A#I#Bar``1(``0)</summary>
+ </member>
+ <member name="M:Container`2.A#I#Foo">
+ <summary>T:Container`2.A#I#Foo</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#IEnumerable#GetEnumerator">
+ <summary>M:Container`2.System#Collections#IEnumerable#GetEnumerator</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#RemoveAt(System.Int32)">
+ <summary>M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#RemoveAt(System.Int32)</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#Insert(System.Int32,`1)">
+ <summary>M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#IndexOf(System.Int32,`1)</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#IndexOf(`1)">
+ <summary>M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#IndexOf(`1)</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#CopyTo(`1[],System.Int32)">
+ <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#CopyTo(`1[],System.Int32)</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Contains(`1)">
+ <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Contains(`1)</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Clear">
+ <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Clear</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Remove(`1)">
+ <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Remove(`1)</summary>
+ </member>
+ <member name="M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Add(`1)">
+ <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Add(`1)</summary>
+ </member>
+ <member name="M:Container`2.GetEnumerator">
+ <summary>M:Container`2.GetEnumerator</summary>
+ </member>
+ </members>
+</doc>
diff --git a/mcs/tests/test-xml-054.cs b/mcs/tests/test-xml-054.cs
new file mode 100644
index 0000000..b9b86c3
--- /dev/null
+++ b/mcs/tests/test-xml-054.cs
@@ -0,0 +1,101 @@
+// Compiler options: -doc:xml-054.xml
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+public class A {
+ public interface I {
+ void Foo ();
+ void Bar<T>(T value);
+ }
+}
+
+/// <summary>T:Container`2</summary>
+public class Container<TKey, TValue> : IList<TValue>, A.I {
+
+ /// <summary>M:Container`2.#ctor</summary>
+ public Container ()
+ {
+ }
+
+ /// <summary>P:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Count</summary>
+ int ICollection<TValue>.Count {get {return 0;}}
+
+ /// <summary>P:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#IsReadOnly</summary>
+ bool ICollection<TValue>.IsReadOnly {get {return true;}}
+
+ /// <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Add(`1)</summary>
+ void ICollection<TValue>.Add (TValue value) {}
+
+ /// <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Remove(`1)</summary>
+ bool ICollection<TValue>.Remove (TValue value) {return false;}
+
+ /// <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Clear</summary>
+ void ICollection<TValue>.Clear () {}
+
+ /// <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#Contains(`1)</summary>
+ bool ICollection<TValue>.Contains (TValue value) {return false;}
+
+ /// <summary>M:Container`2.System#Collections#Generic#ICollection&lt;TValue&gt;#CopyTo(`1[],System.Int32)</summary>
+ void ICollection<TValue>.CopyTo (TValue[] array, int arrayIndex) {}
+
+ /// <summary>M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#IndexOf(`1)</summary>
+ int IList<TValue>.IndexOf (TValue value) {return -1;}
+
+ /// <summary>M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#IndexOf(System.Int32,`1)</summary>
+ void IList<TValue>.Insert (int index, TValue item) {}
+
+ /// <summary>M:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#RemoveAt(System.Int32)</summary>
+ void IList<TValue>.RemoveAt (int index) {}
+
+ /// <summary>P:Container`2.System#Collections#Generic#IList&lt;TValue&gt;#Item(System.Int32)</summary>
+ TValue IList<TValue>.this [int index] {
+ get {return default (TValue);}
+ set {}
+ }
+
+ /// <summary>M:Container`2.System#Collections#IEnumerable#GetEnumerator</summary>
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return GetEnumerator ();
+ }
+
+ /// <summary>M:Container`2.GetEnumerator</summary>
+ public IEnumerator<TValue> GetEnumerator ()
+ {
+ yield break;
+ }
+
+ /// <summary>T:Container`2.A#I#Foo</summary>
+ void A.I.Foo ()
+ {
+ }
+
+ /// <summary>T:Container`2.A#I#Bar``1(``0)</summary>
+ void A.I.Bar<T> (T value)
+ {
+ }
+
+ /// <summary>T:Container`2.Element</summary>
+ public class Element : ICloneable {
+
+ /// <summary>M:Container`2.Element.System#ICloneable#Clone</summary>
+ object ICloneable.Clone ()
+ {
+ return Clone ();
+ }
+
+ /// <summary>M:Container`2.Element.Clone</summary>
+ public Element Clone ()
+ {
+ return (Element) MemberwiseClone ();
+ }
+ }
+}
+
+class Test {
+ public static void Main ()
+ {
+ }
+}
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment