Re: make_ctags: use -I option to ignore pg_node_attr macro
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Yugo NAGATA <nagata@sraoss.co.jp>
Cc: pgsql-hackers@postgresql.org
Date: 2022-10-10T10:04:22Z
Lists: pgsql-hackers
Hello On 2022-Oct-07, Yugo NAGATA wrote: > I found that tag files generated by src/tools/make_ctags > doesn't include some keywords, that were field names of node > structs, for example norm_select in RestrictInfo. Such fields > are defined with pg_node_attr macro that was introduced > recently, like: > > Selectivity norm_selec pg_node_attr(equal_ignore); > > In this case, pg_node_attr is mistakenly interpreted to be > the name of the field. So, I propose to use -I option of ctags > to ignore the marco name. Attached is a patch to do it. I've wondered if there's anybody that uses this script. I suppose if you're reporting this problem then it has at least one user, and therefore worth fixing. If we do patch it, how about doing some more invasive surgery and bringing it to the XXI century? I think the `find` line is a bit lame: > # this is outputting the tags into the file 'tags', and appending > find `pwd`/ -type f -name '*.[chyl]' -print | > - xargs ctags -a -f tags "$FLAGS" > + xargs ctags -a -f tags "$FLAGS" -I "$IGNORE_LIST" especially because it includes everything in tmp_install, which pollutes the tag list. In my own tags script I just call "ctags -R", and I feed cscope with these find lines (find $SRCDIR \( -name tmp_install -prune -o -name tmp_check -prune \) -o \( -name "*.[chly]" -o -iname "*makefile*" -o -name "*.mk" -o -name "*.in" -o -name "*.sh" -o -name "*.sgml" -o -name "*.sql" -o -name "*.p[lm]" \) -type f -print ; \ find $BUILDDIR \( -name tmp_install -prune \) -o \( -name \*.h -a -type f \) -print ) which seems to give decent results. (Nowadays I wonder if it'd be better to exclude the "*_d.h" files from the builddir.) (I wonder why don't I have a prune for .git ...) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ ¡Ay, ay, ay! Con lo mucho que yo lo quería (bis) se fue de mi vera ... se fue para siempre, pa toíta ... pa toíta la vida ¡Ay Camarón! ¡Ay Camarón! (Paco de Lucía)
Commits
-
Fix make_etags breakage on certain platforms.
- af26f28b9fdd 15.4 landed
- ae66716bf3ef 16.0 landed
-
Fix make_etags failure on Mac.
- 87f21d2c6890 16.0 landed
-
Enhance make_ctags and make_etags.
- d1e2a380cb91 16.0 cited