Search Postgresql Archives

Re: I want to search my project source code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane wrote:

> 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.

+1.  The nice thing about a tool that understands code is that you can
query it in ways that make sense to code.  For example I can search for
"all files that include foo.h" or "all callers of function bar" or "all
occurences of the symbol baz".  I use cscope for this, which integrates
nicely into my text editor (vim), and others have told me they use
kscope which puts it inside a nice GUI window, if you care about such
things.

-- 
Alvaro Herrera                  http://www.amazon.com/gp/registry/5ZYLFMCVHXC
"I would rather have GNU than GNOT."  (ccchips, lwn.net/Articles/37595/)

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux