[MonoDevelop] Generics support - Part 2 (PATCH)

Matej Urbas matej.urbas at gmail.com
Sun Jul 23 09:48:26 EDT 2006

Forgot to attach the newly added file...



Finally, I have concluded with the second part of implementing generic
support in MonoDevelop's code completion. (There is still a lot to be
done before we can be happy, though...)

What has been done:

- generic data gets parsed correctly from .NET assemblies (using
Mono.Cecil). This means that code completion databases contain all
generic info about types from every assembly.

- I have improved the way we obtain info for return types and parameters
in methods (generics are included).

- some generic info is already displayed in the code completion window,
but due to some greater design obstacles, I could not do much to make it
perfect/usable - this is the point where we have to redesign the way
code completion works (in source editors).

What has to be done:

- language bindings must fill out generic info about types

- language bindings must know that generic types have a '`#' appended in
their names...

- code completion must be somewhat redesigned to thoroughly support

The patch is attached and ready to commit.


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#).

- 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...

Well, this is only a short term solution. I'll be working on a
redesigned code completion infrastructure and will discuss much before I
implement anything. But for now, we should just get the bare minimum

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonoDevelop-generics-part2.diff
Type: text/x-patch
Size: 32780 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20060723/1145469a/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PersistentGenericParamater.cs
Type: text/x-csharp
Size: 1844 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20060723/1145469a/attachment-0003.bin 

More information about the Monodevelop-list mailing list