Matthew Wilson <matt@tplus1.com> writes:
> At least once a week, I want to find some code that uses a few modules,
> so I have to launch a find + grep at the top of the tree and then wait
> for it to finish.
Personally I use glimpse for this. It's a bit old and creaky but it
performs wonders. There might be something better out there by now.
I wouldn't recommend trying to use a standard FTS to index code:
code is not a natural language and the kinds of searches you usually
want to perform are a lot different. As an example, I glimpse for
"foo" when looking for references to a function foo, but "^foo"
when seeking its definition (this relies on the coding conventions
about function layout, of course). An FTS doesn't think start-of-line
is significant so it can't do that.
regards, tom lane