Skip to content

Commit 8436293

Browse files
authored
Add example to Nushell completions config
1 parent a38ddc6 commit 8436293

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/core/tools/enable-tab-autocomplete.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ dotnet completions script fish | source
9292
#### Nushell
9393

9494
Run `dotnet completions script nushell` and add the snippet it provides to your `config.nu` file.
95+
e.g., if you were not using any external completers, add the following to the end of the file:
96+
```nu
97+
let dotnet_completer = {|spans|
98+
dotnet complete ($spans | str join " ") | lines
99+
}
100+
101+
let multiple_completers = {|spans|
102+
match $spans.0 {
103+
"dotnet" => $dotnet_completer
104+
_ => { [] } # Fallback to empty list
105+
} | do $in $spans
106+
}
107+
108+
$env.config.completions.external.enable = true
109+
$env.config.completions.external.completer = $multiple_completers
110+
```
95111

96112
## Dynamic completion scripts (all versions)
97113

0 commit comments

Comments
 (0)