[Mono-docs-list] MonoDoc type lookups / helpsource improvement
Joshua Tauberer
tauberer@for.net
Mon, 26 May 2003 22:15:17 -0400
This is a multi-part message in MIME format.
--------------060509050007000008090800
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Miguel de Icaza wrote:
> A quick question and a bug report about the new XSLT-based
> Monodoc. This was a question that was asked last week, but I did not
> reply as I was not sure.
I held on to that email (by John Luke, who this is also addressed to).
> The <see cref="...."> lookup system in the ECMA docs accepts:
>
>>T: for types/classes/enums/interfaces
>>M: for methods
>>F: for fields/events.
>>N: for namespaces
And C for constructors, P for properties? Not E for events? I think
they're labeled with E internally.
> The bugs are:
>
> Currently the new system generates a M:Type.Property instead of
> P:Type.Property.
I'll correct that. I was quite confused about what it should have been
since the correct way didn't work. It will do what is listed above (M P
F and C, and with Fs for events).
> Lookups for P:Type.Property are not resolved.
And attached is a patch to correct that bug and other related member
lookup bugs. Applying the patch will allow N, T, M, F, P, E, and C:
lookups to work. (For members, it actually doesn't matter what letter
is used in the URL out of M F P E and C.) I'll commit it once I get the
nod.
--
- Joshua Tauberer
http://taubz.for.net
** Nothing Unreal Exists **
--------------060509050007000008090800
Content-Type: text/plain;
name="provider.cs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="provider.cs.patch"
Index: provider.cs
===================================================================
RCS file: /cvs/public/monodoc/browser/provider.cs,v
retrieving revision 1.24
diff -u -r1.24 provider.cs
--- provider.cs 20 May 2003 00:18:49 -0000 1.24
+++ provider.cs 27 May 2003 02:20:33 -0000
@@ -710,7 +710,21 @@
public string MemberLookup (string prefix, string url, out Node match_node)
{
string rest = url.Substring (2);
+
+ // Dots in the arg list (for methods) confuse this.
+ // Chop off the arg list for now and put it back later.
+ string arglist = "";
+ int argliststart = rest.IndexOf("(");
+ if (argliststart >= 0) {
+ arglist = rest.Substring(argliststart);
+ rest = rest.Substring(0, argliststart);
+ }
+
int member_idx = rest.LastIndexOf (".");
+
+ // The dot in .ctor also confuses this.
+ if (rest.EndsWith("..ctor")) member_idx--;
+
string ns_type = rest.Substring (0, member_idx);
string member = rest.Substring (member_idx + 1);
@@ -723,7 +737,7 @@
}
foreach (HelpSource hs in help_sources){
- string s = hs.RenderTypeLookup (prefix, ns, type, member, out match_node);
+ string s = hs.RenderTypeLookup (prefix, ns, type, member + arglist, out match_node);
if (s != null)
return s;
@@ -773,6 +787,9 @@
case "M:":
case "F:":
+ case "P:":
+ case "E:":
+ case "C:":
return MemberLookup (prefix, url, out match_node);
}
match_node = null;
--------------060509050007000008090800--