[SVN] Bundle commit 472

Kumar McMillan kumar.mcmillan at gmail.com
Wed Mar 16 20:43:55 UTC 2005


On Mon, 14 Mar 2005 20:34:24 -0600, Brad Miller <bonelake at mac.com> wrote:
> Kumar,
> 
> I've been thinking more about how to do the sorting and have methods
> associated with the right classes.
> The general idea :
>     create a dictionary keyed by class names.
>     The values for each key in this dictionary will be a list of the
> methods that we find in that class.
> 
> Now we've got two different regular expressions we want to match for:
>    1. the outer level typically going to be class I guess
>    2. the inner level methods and functions.
> 
> The trick is figuring out an elegant way to fit that into your handler
> classes.

Hey Brad (or anyone else following this thread) -- please take a
looksee at rev 495.  I swallowed my pride and did a PHP-style (uggh)
implementation of my idea for sorting, yes, PHP entities.  This is
only until my brain absorbs the Pythonness that it so craves, and so
you can maybe get some ideas from my implementation.  The commit note
also suggest some "bigger picture" changes that might need to happen
to make this work a little better.

for testing you can use this in your custom bundle:

HOME=~
DEFAULTS="$HOME/Library/Application Support/TextMate/Bundles/Defaults.tmbundle"
"$DEFAULTS/bin/entitynav.py" -f - -E "${TM_FILENAME}" -s

Let me know if you need a PHP class file to test with.


K

> 
> Brad
> 
> On Mar 14, 2005, at 2:59 PM, Brad Miller wrote:
> 
> > Hi Kumar,
> > No problem.
> >
> > I know exactly what you are talking about with the sorting.
> > Personally, I don't think I'll use sorting, I kind keep a mental model
> > of the file in my head so I typically know what order my methods and
> > classes are defined in, seeing them sorted is actually harder for me.
> > I only took on the sorting project because Eric requested it and
> > hacking Python was more exiting to work on than writing my data
> > structures exam. :-)
> >
> > I think I have an idea of how we could keep the the methods sorted
> > with the classes  and present the classes in alphabetical order.
> > Since the data structures exam is ready to go, I should have some time
> > tonight to try a prototype.
> >
> > Brad
> >
> > On Mar 14, 2005, at 2:51 PM, Kumar McMillan wrote:
> >
> >> Hey Brad -- thanks for adding the sort logic.  I shifted some things
> >> around came up with a separate SortableEntities interface.  see
> >> revision 480.  The only thing I couldn't figure out (since I am new to
> >> Python) is how to sort recursively through the groups of matched line
> >> parts.  For example, PHP functions should be sorted but kept grouped
> >> within their class (same goes for Python).  Take a look and let me
> >> know if you have some ideas.  I can send you PHP code examples, but
> >> running the Entity Nav on the entitynav.py file is a good way to see
> >> what I am talking about.
> >>
> >> K
> >
> > Brad Miller, Ph.D.
> > Assistant Professor, Computer Science
> > Luther College
> > http://www.cs.luther.edu/~bmiller
> > _______________________________________________
> > textmate-dev mailing list
> > textmate-dev at lists.macromates.com
> > http://lists.macromates.com/mailman/listinfo/textmate-dev
> >
> Brad Miller, PhD
> Assistant Professor
> Luther College
> http://www.cs.luther.edu/~bmiller
> jabber:  bnmnetp at jabber.org
> 
> 
> _______________________________________________
> textmate-dev mailing list
> textmate-dev at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate-dev
> 
> 
>



More information about the textmate-dev mailing list