[MonoDevelop] [PATCH] Fix Improper MemberNodeCommandHandling inClassPad

Lluis Sanchez lluis at ximian.com
Tue May 29 07:21:41 EDT 2007


> > >
> > > One possibility is to have the pidb loading code keep a table of unique
> > > FileName strings as they are loaded from disk, and set the instance to
> > > the unique string rather than the one loaded.
>  So, I think the filename table should be maintained for each Class.
> Or do we need to have a global one? Having a per class filename table
> adds only a little overhead as it duplicates the filename between all
> classes declared in the same file. So which one would be better? If it
> is chosen to go for a global table,  is there anything wrong in making
> it have a static reference in the class 'DefaultClass' ?
> 
> Can it be done in this way? Please explain.

I would do the following:

      * At parse time, assign the file name to IClass and to all its
        IMembers. In fact, every parsed class goes through a resolving
        process which resolved referenced types, so even if the parser
        does not assign a file name to each member, the resolving
        process could do it.
      * When saving an IClass to the pidb file, check the filename of
        each IMember, and if it is the same as the IClass filename,
        don't store it again (store it as null).
      * When loading an IClass, check all loaded IMembers. Assign the
        IClass file name to all IMembers with a null filename in the
        region.

Notice that each part of a partial class is stored individually as an
IClass, so the previous process would also work for sharing strings for
partial classes.

Lluis.




More information about the Monodevelop-list mailing list