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