Skip to content

Commit 6b94aa0

Browse files
authored
Make uv completer compatible with Nu v106 (#1146)
1 parent 798a28e commit 6b94aa0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

custom-completions/uv/uv-completions.nu

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nu-version: 0.102.0
1+
# nu-version: 0.106.0
22

33
# This script was created by dumping the output of `uv generate-shell-completion` and adding more completers.
44

@@ -92,7 +92,7 @@ module completions {
9292

9393
def get-groups []: nothing -> list<string> {
9494
let file = (find-pyproject-file)
95-
try { open $file | get -i dependency-groups | columns } catch { [] }
95+
try { open $file | get -o dependency-groups | columns } catch { [] }
9696
}
9797

9898
# Groups completer for subcommands
@@ -115,20 +115,20 @@ module completions {
115115
# Get packages from "project.dependencies"
116116
def get-main-packages [] {
117117
let file = (find-pyproject-file)
118-
try { open $file | get -i project.dependencies | parse-package-names } catch { [] }
118+
try { open $file | get -o project.dependencies | parse-package-names } catch { [] }
119119
}
120120

121121
# Get packages from "project.optional-dependencies"
122122
def get-optional-packages [] {
123123
let file = (find-pyproject-file)
124-
try { open $file | get -i project.optional-dependencies | parse-package-names } catch { [] }
124+
try { open $file | get -o project.optional-dependencies | parse-package-names } catch { [] }
125125
}
126126

127127
# Get packages from "dependency-groups".
128128
# Ref: https://packaging.python.org/en/latest/specifications/dependency-groups/#dependency-groups
129129
def get-dependency-group-packages [only_group?: string] {
130130
let file = (find-pyproject-file)
131-
let dg = try { open $file | get -i dependency-groups } catch { [] }
131+
let dg = try { open $file | get -o dependency-groups } catch { [] }
132132
# One group can include other groups, like:
133133
# dev = ['click', { include-group = "docs" }, { include-group = "linting" }, { include-group = "test" }]
134134
let handle_line = {|p| if (($p | describe) == 'string') { $p } else { $dg | get ($p.include-group) } }
@@ -147,8 +147,8 @@ module completions {
147147
let preceding = $context | str substring ..$position
148148
let prev_tokens = $preceding | str trim | args-split
149149
# Check if "--group" is specified
150-
let go = $prev_tokens | enumerate | find '--group' | get -i index.0
151-
let group = if ($go | is-not-empty) { $prev_tokens | get -i ($go + 1)}
150+
let go = $prev_tokens | enumerate | find '--group' | get -o index.0
151+
let group = if ($go | is-not-empty) { $prev_tokens | get -o ($go + 1)}
152152
if ($group | is-empty ) {
153153
get-all-dependencies
154154
} else {

0 commit comments

Comments
 (0)