Skip to content
Merged
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 @@ -18,31 +18,13 @@ public class NushellShellProvider : IShellProvider

private static readonly string _dynamicCompletionScript =
"""
# 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 }
def "nu-complete dotnet" [context: string] {
^dotnet complete $"($context)" | lines
}

# 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
}
}
}
export extern "dotnet" [
...command: string@"nu-complete dotnet"
]
""";

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