[TxMt] Something like flymake possible for TextMate?

Thomas Aylott - subtleGradient textmate at subtleGradient.com
Fri Mar 14 17:37:47 UTC 2008


On Mar 14, 2008, at 12:45 PM, Johannes Beigel wrote:

> Am 14.03.2008 um 16:22 schrieb Thomas Aylott - subtleGradient:
>> I'm not exactly sure what all flymake does…
>
> It's calling an external code validator while you are editing source  
> code. Some people tend to find this annoying, others find it really  
> useful.
>
> I would be interested to know if such a thing is possible in  
> TextMate: Essentially one has to repeatedly and asynchronously call  
> a matching external validator after each edit (whereby one has to  
> define what to count as "an edit", the most extreme strategy would  
> be after every keystroke, but this could lead to too much load).
>
>> But a number of bundles have validation commands.
>
> Sure, I am aware of e.g. PyCheckMate. flymake just uses tools like  
> pyflakes or gcc to do the actual code validation, but you don't have  
> to explicitly invoke it and – maybe more important – you don't have  
> to remember to do it.
>
> -Jojo

Well, there might be a way to do it.
There's a little-used feature called the Web Preview Window available  
in the Windows menu.
It has a drawer with options for filtering the current document  
through a shell script and then displaying the results.
You can have it run x.x number of seconds after and change.

I currently use it to live preview textile/markdown and do a live diff  
of my code with the saved version of it.

You could totally write a validation script that looks at the current  
scope to determine what validator to use.
Then the validator could output HTML with textmate links to the lines  
with the errors.

Here's my current live preview / live diff web preview script:
	http://textmate.svn.subtlegradient.com/Bundles/tAylott_subtleGradient.tmbundle/Support/bin/42_TextMate_live_preview.rb

Please let me know what you come up with, this could be a very handy  
tool.

—Thomas Aylott – subtleGradient—


More information about the textmate mailing list