Skip to content

Commit

Permalink
feat(dotnet): update completion script (ohmyzsh#12028)
Browse files Browse the repository at this point in the history
  • Loading branch information
nachtjasmin authored Dec 6, 2023
1 parent 346bd1c commit 48ccc7b
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions plugins/dotnet/dotnet.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# This scripts is copied from (MIT License):
# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh
# https://raw.githubusercontent.com/dotnet/sdk/main/scripts/register-completions.zsh

_dotnet_zsh_complete()
{
local completions=("$(dotnet complete "$words")")

# If the completion list is empty, just continue with filename selection
if [ -z "$completions" ]
then
_arguments '*::arguments: _normal'
return
fi

# This is not a variable assignment, don't remove spaces!
_values = "${(ps:\n:)completions}"
#compdef dotnet
_dotnet_completion() {
local -a completions=("${(@f)$(dotnet complete "${words}")}")
compadd -a completions
_files
}

compdef _dotnet_zsh_complete dotnet
compdef _dotnet_completion dotnet

# Aliases bellow are here for backwards compatibility
# added by Shaun Tabone (https://github.com/xontab)
Expand Down

0 comments on commit 48ccc7b

Please sign in to comment.