edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Tab doesn't do anything

Open vpetrovykh opened this issue 5 years ago • 4 comments

  • EdgeDB Version: EdgeDB 1.0-alpha.4+dev.68.g2f119281
  • EdgeDB CLI Version: edgedb-cli 1.0.0-alpha.4
  • OS Version: gentoo linux

When writing any query pressing "tab" doesn't do anything at all. It should actually perform tabulation (whether by inserting spaces or actual tab characters). This is especially annoying with nested queries (I used to copy/paste them a lot so I didn't notice before).

vpetrovykh avatar Jul 15 '20 01:07 vpetrovykh

Hm. I think tab is reserved for completion. We can probably do some magic to make it doing indentation, but not "tabulation" in the middle of the line, because that would conflict with completion (and yes, we don't have completion for queries yet, but we want to have).

tailhook avatar Jul 15 '20 09:07 tailhook

I think that using it to indent if the line before the cursor contains only whitespace and to auto-complete otherwise is fine. Basically, the reasoning is that at the beginning of the line "autocomplete" could literally mean "indent please".

vpetrovykh avatar Jul 18 '20 01:07 vpetrovykh

+1 to what Victor said. This is how CPython repl behaves, for instance.

1st1 avatar Jul 22 '20 20:07 1st1

Note from slack discussion:

  1. We want auto-formatting that makes Tab obsolete
  2. We want completion to eventually work on empty line like this:
edgedb> SELECT User {
.......   <tab x 2>   

(i.e. complete fields of the User type)

tailhook avatar Oct 01 '20 10:10 tailhook