repl: tab completion doesn't work for quoted attrs #1193
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
diagnostics
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
Importance
High
Importance
Low
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
Release Blocking
Non-urgent
Release Blocking
Urgent
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
Urgency
High
Urgency
Low
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
trying to tab-complete an attribute name that needs to be quoted doesn't work if the user doesn't already know it needs to be quoted. tt also isn't considered for completion if there is another attribute with an identical prefix that doesn't need to be quoted.
Steps To Reproduce
note that the inverse is also true: trying to quote an attribute will never consider attribute names that don't need to be quoted:
Expected behavior
at the very least, the repl should show that the attribute exists, instead of acting like there's nothing that starts with "tiler" in the attrset. same goes for the opposite direction:
"tilix"should be a candidate completion fora."til<TAB>.since quoting an attribute name is always valid, the repl could quote the entire prefix if there is a quoted name in the completions, though i'm not sure how much AST wrangling that might involve? idk how the completion system works yet.
nix --versionoutputAdditional context
for context, i was trying to find "tiling-assistant@leleat-on-github" in nixpkgs's
pkgs.gnome46Extensionsby searching forgnome46Extensions.tiling-a<TAB>(sincepkgs.gnomeExtensionsnames it simplytiling-assistant, which doesn't need to be quoted), but nothing was coming up, so i thought it just didn't exist :| then i triedattrNames gnome46Extensionsand manually scrolled to find it.looks like https://git.lix.systems/lix-project/lix/src/branch/main/lix/libcmd/repl.cc#L532 should check from
1instead of0if the character at0is a"This issue was mentioned on Gerrit on the following CLs: