Re: I want to search my project source code - Mailing list pgsql-general

From Tom Lane
Subject Re: I want to search my project source code
Date
Msg-id 17159.1193495105@sss.pgh.pa.us
Whole thread Raw
In response to I want to search my project source code  (Matthew Wilson <matt@tplus1.com>)
Responses Re: I want to search my project source code  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: WAL archiving idle database
Next
From: Oleg Bartunov
Date:
Subject: Re: I want to search my project source code