[MonoDevelop] Who ate my code templates ?

Mike Krüger mike at icsharpcode.net
Mon Mar 23 09:22:45 EDT 2009


Hi

> I've seen there is a "Is surround with template" checkbox in the code
> template dialog. Can't we just assume it's a surround template if it
> contains a $selected$ variable?
> 

It's easier to read a flag than to parse the template text. But
generally you're right. I'll think about it.

> It would be useful if the code completion list also took into account
> the context. For example, when inside a method, the 'class' template
> should not be offered in the code completion list.
> 

Yes that falls under 'extending the template contexts' extension :). The
expression context is just ment to be a demo. We could add some more
contexts - when we've time.

> I find this concept of "Function" not easy to understand when you see it
> in the code template dialog. Looks like it is a way of setting the
> default value of a variable, but the column header does not help on
> making it clear, and there is a value like "GetCollections()" which
> doesn't looks like a function for getting a default value. Also, there
> is already a "Default" column you can set at the same time. And what is
> the Values column for?
> 

Thats the downside of such a subsystem that tries to solve many things,
I'm not even sure if it wouldn't be easier to just let the users edit
the xml directly :)

There are two methods how the variables get their data: statically
defined in the xml or dynamically by a method call. 

static method:
Fields have a default value and they can define a set (==Values) of
'valid' values that are represented as popup so the user can choose
from. Try the 'Attribute' template this demonstrates it.

dynamic method (==Function):
A method handles the default & values - thats all :). Now the
"functions" clearly need some sort of documentation - tooltip ? (And
some extensions. I think there could be many more functions ... alone
for naming conversions).

The template editor currently doesn't allow to set the 'values'. I don't
have a good way to represent them. I would do a '...' button in the
'edit' field and an editor popping up letting the user define the
values. But I think the template editor needs some work out of how it
should function. I'm open for suggestions :)

I don't like the 'variable' list at the bottom. Maybe just having a
property grid to the right and a popup over the grid for selecting the
variable should work better ?
My idea would be having always the variable under the cursor selected in
the propertygrid as default. How does this sound ?

Regards
Mike




More information about the Monodevelop-list mailing list