From d093af428a70ca2147f83d472683a95cab2dfa4c Mon Sep 17 00:00:00 2001 From: Jasmin Date: Mon, 6 Nov 2023 11:12:47 +0100 Subject: [PATCH] refactor(dotnet): include newest .NET upstream changes --- plugins/dotnet/dotnet.plugin.zsh | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index 89d464670..40ee7efae 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -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)