[MonoDevelop] Goto class patch

Lluis Sanchez lluis at ximian.com
Wed May 18 14:12:21 EDT 2005


> Hmm, I think I will give an example of what I mean. Suppose you have this code:
> 
> 1: int i;
> 2: int j;
> 3:
> 4: i = 7;
> 
> If you position your cursor on i on line 4, I want a method which
> gives me the element at line 1. From this element I could then extract
> the position via the Region property. So I need a method which should
> do something like: "give me the declaring element". This method would
> get the string i as argument and return the IField (or whatever it is
> called) object for line 1. Is this not what we need?

Yeah, that's it. It would return an IField if 'i' is a field, and we
probably need something like IVariable for when 'i' is a variable. It
should also return an IClass if the cursor is on "int".

> 
> > >
> > > We could then add some code to get the type as well. But if I am not
> > > wrong, the MonodocResolver does this job. So maybe we should use this
> > > (and possibly rename it) for the tool tip functionality?
> > 
> > I'm not sure to understand. The GotoDefinitionResolver method in your
> > patch returns an IClass, that is, a type. If MonodocResolver does the
> > same, there is no need for a new one (after renaming MonodocResolver of
> > course).
> 
> It is true that the GotoDefinitionResolver method returns an IClass,
> but the patch was only intended as a demonstration to see if people
> agreed that such functionality was needed in MD. It should not return
> an IClass but something more general.

Agreed.

Lluis.




More information about the Monodevelop-list mailing list