Re: tab-completion debug print
От | David Fetter |
---|---|
Тема | Re: tab-completion debug print |
Дата | |
Msg-id | 20181125001727.GM958@fetter.org обсуждение исходный текст |
Ответ на | Re: tab-completion debug print (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: tab-completion debug print
|
Список | pgsql-hackers |
On Fri, Nov 23, 2018 at 04:32:31PM -0500, Tom Lane wrote: > Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes: > > I was reminded that I was often annoyed with identifying the code > > that made a word-completion, by hearing the same complaint from a > > collegue of mine just now. > > Something like the attached that tweaks completion_matches calls > > lets psql emit the line number where a word-completion > > happens. The output can be split out using redirection so that it > > doesn't break into the conversation on console. > > > (make -s COPT=-DTABCOMPLETION_DEBUG install) > > $ psql postgres 2>~debug.out > > =# alt[tab]er [tab]t[tab]ab[tab] [tab] > > > You can see the following output in another bash session. > > $ tail -f ~/debug.out > > [1414][1435][1435][1435][1431] > > Every number enclosed by brackets is the line number in > > tab-complete.c, where completion happens. > > > Is this useful? Any suggestions, thoughts? > > Hm. I can see the value of instrumenting tab-complete when you're trying > to debug why it did something, but this output format seems pretty terse > and unreadable. Can we get it to print the completion text as well? > I'm imagining something more like > > 1414: "er " > 1435: "" > 1435: "ab" > 1435: "" > 1431: "" > > Perhaps there's room as well to print the context that the match looked > at: > > 1414: "alt" -> "er " > 1435: "alter " -> "" > 1435: "alter t" -> "ab" > > etc. > > regards, tom lane Is this something along the lines of what you had in mind? Best, David. -- David Fetter <david(at)fetter(dot)org> http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
Вложения
В списке pgsql-hackers по дате отправления: