Completion for commands (starting with ":") in repl #361

Closed
opened 2024-05-30 04:17:59 +00:00 by aleksanaa · 4 comments

When typing : in nix repl and pressing tab, the completion is the same with not typing anything and pressing tab, instead of a list of available commands. When typing :lo and pressing tab, nothing happens.

Describe the solution you'd like

Completions for these commands appear when prefixed with :

Describe alternatives you've considered

Not displaying completion of any commands?

Additional context

I've opened an issue in https://github.com/NixOS/nix/issues/10509 but since I want to give lix a try, I'd like to also opening an issue here to see if I can get a response.

## Is your feature request related to a problem? Please describe. When typing `:` in `nix repl` and pressing tab, the completion is the same with not typing anything and pressing tab, instead of a list of available commands. When typing `:lo` and pressing tab, nothing happens. ## Describe the solution you'd like Completions for these commands appear when prefixed with `:` ## Describe alternatives you've considered Not displaying completion of any commands? ## Additional context I've opened an issue in https://github.com/NixOS/nix/issues/10509 but since I want to give lix a try, I'd like to also opening an issue here to see if I can get a response.
jade added the
ux
label 2024-05-30 07:10:38 +00:00
jade added the
Area/repl
label 2024-05-30 07:11:38 +00:00
Owner

This shouldn't be too hard. The : commands currently are hardcoded (lol) in src/libcmd/repl.cc in NixRepl::processLine(). We just need to shove the list of possible colon commands in NixRepl::completePrefix() in src/libcmd/repl.cc behind a prefix.starts_with(":")

We are currently working on #306, but can tackle this after because this should really be a thing

This shouldn't be too hard. The `:` commands currently are hardcoded (lol) in `src/libcmd/repl.cc` in `NixRepl::processLine()`. We just need to shove the list of possible colon commands in `NixRepl::completePrefix()` in `src/libcmd/repl.cc` behind a `prefix.starts_with(":")` We are currently working on https://git.lix.systems/lix-project/lix/issues/306, but can tackle this after because this should really be a thing
qyriad added the
E/easy
label 2024-05-30 18:45:59 +00:00
Owner

we would love if there were a registry of repl commands, which would make this easier.

we would love if there were a registry of repl commands, which would make this easier.
Owner
https://gerrit.lix.systems/c/lix/+/1367
qyriad self-assigned this 2024-06-01 00:30:00 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/1367 ("repl: implement tab completing :colon commands")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/1367", "number": 1367, "kind": "commit message"}], "cl_meta": {"1367": {"change_title": "repl: implement tab completing :colon commands"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/1367](https://gerrit.lix.systems/c/lix/+/1367) ("repl: implement tab completing :colon commands")
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#361
No description provided.