Re: make_ctags: use -I option to ignore pg_node_attr macro

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: make_ctags: use -I option to ignore pg_node_attr macro
Дата
Msg-id 20221010100422.emtameznrz4b2bak@alvherre.pgsql
обсуждение исходный текст
Ответ на make_ctags: use -I option to ignore pg_node_attr macro  (Yugo NAGATA <nagata@sraoss.co.jp>)
Ответы Re: make_ctags: use -I option to ignore pg_node_attr macro  (Yugo NAGATA <nagata@sraoss.co.jp>)
Re: make_ctags: use -I option to ignore pg_node_attr macro  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список 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)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ajin Cherian
Дата:
Сообщение: Re: Support logical replication of DDLs
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [BUG] Logical replica crash if there was an error in a function.