Hello On Mon, 10 Oct 2022 12:04:22 +0200 Alvaro Herrera <alvhe...@alvh.no-ip.org> wrote:
> 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. Yeah, I am a make_ctags user, there may be few users though.... > 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 ) Thank you for your comments. I updated the patch to ignore the code under tmp_install and add some file types like sql, p[lm], and so on. .sgml or .sh is not included because they don't seem to be beneficial for ctags. Regards, Yugo Nagata -- Yugo NAGATA <nag...@sraoss.co.jp>
diff --git a/src/tools/make_ctags b/src/tools/make_ctags index 912b6fafac..b1070dcea9 100755 --- a/src/tools/make_ctags +++ b/src/tools/make_ctags @@ -34,9 +34,17 @@ then FLAGS="--c-kinds=+dfmstuv" else FLAGS="-dt" fi +# Use -I option to ignore a macro +if [ "$IS_EXUBERANT" ] +then IGNORE_IDENTIFIES="-I pg_node_attr+" +else IGNORE_IDENTIFIES= +fi + # this is outputting the tags into the file 'tags', and appending -find `pwd`/ -type f -name '*.[chyl]' -print | - xargs ctags -a -f tags "$FLAGS" +find `pwd`/ \( -name tmp_install -prune -o -name tmp_check -prune \) \ + -o \( -name "*.[chly]" -o -iname "*makefile*" -o -name "*.mk" -o -name "*.in" \ + -o -name "*.sql" -o -name "*.p[lm]" \) -type f -print | + xargs ctags -a -f tags "$FLAGS" "$IGNORE_IDENTIFIES" # Exuberant tags has a header that we cannot sort in with the other entries # so we skip the sort step