21st Century Digital Boy

September 8, 2008

Finding FIXME in BBEdit

Filed under: Uncategorized — Tags: , — Gregg @ 12:01 pm

BBedit 9 supports finding “fixme’s”: it’ll search for instances of FIXME or TODO in code. However it inexplicably only works in C/C++ and Ruby.

Aside: Quick, which language is this comment in?

// FIXME: This needs work.

The correct answer is “One of: C, C++, Java, JavaScript, PHP, and maybe others.” I suppose we’ll see those languages supporting the FIXME in later versions …

Anyway, here’s an Applescript to find all the FIXME/TODOs in a document:

tell application "BBEdit"
set searchString to "(\\/\\/|#)\\s*(FIXME|TODO)[\\s:]*(.*)"
set theResult to find (searchString as string) searching in document of text window 1 options {wrap around:true, text files only:true, starting at top:true, case sensitive:true, search mode:grep}
end tell

That works pretty well enough, until they add it to other languages…

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Blog at WordPress.com.