Skip to content

Commit

Permalink
nix: re-add directory completion
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 22, 2024
1 parent a51229f commit b4e7cb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion completers/nix_completer/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func init() {
})

carapace.Gen(buildCmd).PositionalCompletion(
nix.ActionFlakeRefs(),
carapace.Batch(
carapace.ActionDirectories(),
nix.ActionFlakeRefs(),
).ToA(),
)
}
5 changes: 4 additions & 1 deletion completers/nix_completer/cmd/develop.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func init() {
})

carapace.Gen(developCmd).PositionalCompletion(
nix.ActionFlakeRefs(),
carapace.Batch(
carapace.ActionDirectories(),
nix.ActionFlakeRefs(),
).ToA(),
)
}
1 change: 0 additions & 1 deletion pkg/actions/tools/nix/flake.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func ActionFlakeRefs() carapace.Action {
return carapace.ActionMultiPartsN("#", 2, func(c carapace.Context) carapace.Action {
switch len(c.Parts) {
case 0:
// TODO add directory completion externally
return ActionFlakes().Suffix("#")
default:
return ActionFlakeAttributes(c.Parts[0])
Expand Down

0 comments on commit b4e7cb4

Please sign in to comment.