Re: Making tab-complete.c easier to maintain

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Making tab-complete.c easier to maintain
Дата
Msg-id CAB7nPqS0-TjcwUWM4R+-77aCrAz9B6a+S_d973CeJvfLm7r-Tg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Making tab-complete.c easier to maintain  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Making tab-complete.c easier to maintain  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Making tab-complete.c easier to maintain  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Dec 19, 2015 at 5:42 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> [ tab-complete-macrology-v11.patch.gz ]
>
> A couple of stylistic reactions after looking through the patch for the
> first time in a long time:
>
> 1. It seems inconsistent that all the new macros are named in CamelCase
> style, whereas there is still plenty of usage of the existing macros like
> COMPLETE_WITH_LIST.  It looks pretty jarring IMO.  I think we should
> either rename the new macros back to all-upper-case style, or rename the
> existing macros in CamelCase style.
>
> I slightly favor the latter option; we're already pretty much breaking any
> hope of tab-complete fixes applying backwards over this patch, so changing
> the code even more doesn't seem like a problem.  Either way, it's a quick
> search-and-replace.  Thoughts?

Both would be fine, honestly. Now if we look at the current code there
are already a lot of macros IN_UPPER_CASE, so it would make more sense
on the contrary to have MATCHES_N and MATCHES_EXCEPT?

> 2. Why does MatchAnyExcept use "'" as the inversion flag, rather than
> say "!" or "~" ?  Seems pretty random.

Actually, "'" is not that much a good idea, no? There could be single
quotes in queries so there is a risk of interfering with the
completion... What do you think would be good candidates? "?", "!",
"#" or "&"?
-- 
Michael



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

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: pg_tables bug?
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: extend pgbench expressions with functions