Re: adding tab completions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: adding tab completions
Дата
Msg-id 11475.1537558154@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: adding tab completions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I wrote:
> The main thing that is bothering me about the remainder is its desire
> to offer single-punctuation-character completions such as "(".  I do
> not see the point of that.  You can't select a completion without
> typing at least one character, so what does it accomplish to offer
> those options, except clutter?

Actually, after poking at it for awhile, I noticed there was a much bigger
problem: tests like

    else if (HeadMatches2("VACUUM", "("))

would continue to fire even if the option list was complete, so that
after typing say

    vacuum ( verbose ) 

you would not get offered any table names, only option names.

I experimented with various fixes for that, but the only one that
worked required extending word_matches() to allow a wildcard in the
middle of a pattern.  (Before it only allowed one at the end; but
it takes just a couple more lines of code to improve that.)  With
that, we can do

    else if (HeadMatches2("VACUUM", "(*") &&
             !HeadMatches2("VACUUM", "(*)"))

and this test will not trigger if the option list is complete.

I've gone ahead and pushed it with those changes.

            regards, tom lane


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

Предыдущее
От: "Nasby, Jim"
Дата:
Сообщение: Re: How to get active table within a transaction.
Следующее
От: Arthur Zakirov
Дата:
Сообщение: Re: [HACKERS] proposal: schema variables