[MonoDevelop] Generics support - Part 2 (PATCH)

Matej Urbas matej.urbas at gmail.com
Mon Jul 24 08:38:13 EDT 2006


Here is a new patch. Many thanks go to Jb Evain for his explanations on

On Mon, 2006-07-24 at 13:58 +0200, Lluis Sanchez wrote:
> Some comments:
>       * Forcing all language bindings and other parser users to link
>         against Cecil just to be able to reuse one enum is not a good
>         deal. We don't really need that dependency.

Check! Have changed it to System.Reflection.GenericParameterAttributes -
which is compatible with Mono.Cecil.GenericParamAttributes.

>       * In ReflectionReturnType.cs, maybe you should set the arrays
>         ArrayList to null once it has been converted to an int[], since
>         it won't be needed anymore.

I have fixed that a couple of hours ago - was just about to post the new
patch. (I have introduced a local variable for that reason and it is
lazily created - that's because it's quite more often NOT needed than it

> other than that, the patch looks great. More comments inline.
> > Discussion:
> > 
> > You will notice, that generic types have a '`#' appended to their names.
> > Since Alejandro and Miguel have pointed out that this is the standard
> > naming convention of CLS (and it sure makes perfect sence), I have
> > decided that FullyQualifiedNames MUST preserve this naming convention.
> > But since language bindings don't understand this naming convention (and
> > since MonoDevelop's code completion doesn't trim the aforementioned
> > suffix) MonoDevelop doesn't recognize generic types, and hence members
> > for all generic types are invisible for now. (Note that generic members
> > of non-generic types ARE visible already...)
> > 
> > To solve this, I suggest the following (a short term solution):
> > 
> > - we introduce a new method in IAmbience - namely 'string
> > ConvertName(IClass)', which only removes the suffix and perhaps adds the
> > generic parameters (e.g.: enclosed in '<' and '>' for C#).
> I think that by providing the correct ConversionFlags combination we can
> already get this text using the existing 'Convert' method. And if not,
> maybe we should add new flags.

Aye. Will look into it later.

> > 
> > - we introduce a new property in the CodeCompletionWindow which contains
> > the correct 'completionString'. Now, it seems, that MonoDevelop uses the
> > string which is used in the code completion popup to display names, but
> > the problem is that characters '<' and '>' get replaced by '&lt;' and
> > '&gt;' - which makes no sense in the SourceEditor...
> This looks like a bug. I don't see the need of using the pango formatted
> text in the completion window. We should check what's wrong there.

Well, I have already tested the new generics data with the ConvertName
method (which appends generic parameters for classes - and is then shown
in the code completion window) but I tried only with &gt; and &lt;
entities... Perhaps it is not pango formatted... I will check that.

> Thanks.
> Lluis.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonoDevelop-Generics-Part2.diff
Type: text/x-patch
Size: 30717 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20060724/6e860d14/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PersistentGenericParamater.cs
Type: text/x-csharp
Size: 1862 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20060724/6e860d14/attachment-0003.bin 

More information about the Monodevelop-list mailing list