[SVN] Re: Align Source

Mads Hartmann Jensen Mads379 at gmail.com
Wed May 25 15:53:35 UTC 2011



Allan Odgaard-4 wrote:
> 
> James?
> 
> We’ve been talking loosely about providing a testing system for TM
> commands. IMO this should be language neutral, so I (i.e. TextMate)
> provides a “command runner” (CLI) that takes input and expected output.
> 
> So perhaps this is my cue to put out a prototype for this.
> 
> Of course if I provide a test runner, this would require the thing to be a
> tmCommand, not a stand-alone ruby script. But that’s hardly a concern,
> what I really is focused on wrt. tests for this command is that we collect
> a versatile set of test cases, so we can tweak the code and patterns w/o
> doing the wrong thing on code in the wild and/or see how it affects that
> code.
> 

That would be cool. I'll have a quick look at james and see if I can set up
some tests till you get back from vacation and have time to take a look at
the tmCommand test tool :)



Allan Odgaard-4 wrote:
> 
> Remember that because we just have a list of regexps, we can add the
> proper pattern only for the obj-c scope, even limit it to inside […] as we
> have a scope for that — that is, when we (optionally) read the list from
> the environment.
> 

Ah, hadn't thought about that... This command is taking shape nicely ;)

I'm currently teaching it how to automatically find the blocks of code in
the file/selection that should be formatted together. So far I have the
following heuristics 

- A line belongs to the previous block if it has the same indentation
- A blank line ends a block 

That should take care of most cases. If everything else fails the user can
always just select the lines manually :)

-- 
View this message in context: http://old.nabble.com/Align-Source-tp31636561p31700281.html
Sent from the textmate-dev mailing list archive at Nabble.com.



More information about the textmate-dev mailing list