Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,22 @@ public class NushellShellProvider : IShellProvider
"""
# Add the following content to your config.nu file:

let external_completer = { |spans|
{
dotnet: { ||
dotnet complete (
$spans | skip 1 | str join " "
) | lines
}
} | get $spans.0 | each { || do $in }
let dotnet_completer = {|spans|
dotnet complete ($spans | str join " ") | lines
}
Comment thread
sibber5 marked this conversation as resolved.

# And then in the config record, find the completions section and add the
# external_completer that was defined earlier to external:

let-env config = {
# your options here
completions: {
# your options here
external: {
# your options here
completer: $external_completer # add it here
}
}
# Add the dotnet completer.
# (see https://nushell.sh/cookbook/external_completers.html#multiple-completer for more info)
let multiple_completers = {|spans|
match $spans.0 {
# Add the dotnet completer
"dotnet" => $dotnet_completer
_ => { [] } # Fallback to empty list, or a completer such as $carapace_completer from the example in the nushell docs.
} | do $in $spans
}
Comment thread
sibber5 marked this conversation as resolved.

$env.config.completions.external.enable = true
$env.config.completions.external.completer = $multiple_completers
""";

public string GenerateCompletions(System.CommandLine.Command command) => _dynamicCompletionScript;
Expand Down
Loading