From f0c9f74f556237d87fea153a76cb05ed833c9f07 Mon Sep 17 00:00:00 2001 From: abgox Date: Thu, 19 Dec 2024 18:18:40 +0800 Subject: [PATCH] feat(completions): update scoop --- completions/scoop/guid.txt | 2 +- completions/scoop/hooks.ps1 | 13 ++++++++++++- completions/scoop/language/en-US.json | 3 +++ completions/scoop/language/zh-CN.json | 3 +++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/completions/scoop/guid.txt b/completions/scoop/guid.txt index be5e065..9e50cbf 100644 --- a/completions/scoop/guid.txt +++ b/completions/scoop/guid.txt @@ -1 +1 @@ -32669e0d-e174-442a-a5f5-3f4df843c40d +158f815b-cab5-407f-94ff-a91275d54230 diff --git a/completions/scoop/hooks.ps1 b/completions/scoop/hooks.ps1 index 88e82bd..957f360 100644 --- a/completions/scoop/hooks.ps1 +++ b/completions/scoop/hooks.ps1 @@ -149,7 +149,7 @@ function handleCompletions($completions) { $current_value = $c.Name $info = $PSCompletions.completions_data.scoop.root.config.$($PSCompletions.guid).Where({ $_.CompletionText -eq $current_value })[0].ToolTip if (!$info) { - $info = @($PSCompletions.info.current_value + ': ' + $current_value) + $info = @($PSCompletions.info.current_value + ': ' + ($c.Definition -replace '^.+=', '')) } if ($current_value -notin $completions_list) { $tempList += $PSCompletions.return_completion($current_value, $PSCompletions.replace_content($info)) @@ -157,6 +157,17 @@ function handleCompletions($completions) { } } } + 'alias' { + switch ($filter_input_arr[1]) { + 'rm' { + if ($filter_input_arr.Count -eq 2) { + foreach ($a in (Get-Member -InputObject (scoop config alias) -MemberType NoteProperty)) { + $tempList += $PSCompletions.return_completion($a.Name, ($a.Definition -replace '^.+=', '')) + } + } + } + } + } } return $tempList + $completions } diff --git a/completions/scoop/language/en-US.json b/completions/scoop/language/en-US.json index 1b3f704..6d736cd 100644 --- a/completions/scoop/language/en-US.json +++ b/completions/scoop/language/en-US.json @@ -442,6 +442,9 @@ }, { "name": "rm", + "symbol": [ + "SpaceTab" + ], "tip": [ "U: rm \n", "Remove command aliases\n", diff --git a/completions/scoop/language/zh-CN.json b/completions/scoop/language/zh-CN.json index c97cd8c..f90fe87 100644 --- a/completions/scoop/language/zh-CN.json +++ b/completions/scoop/language/zh-CN.json @@ -440,6 +440,9 @@ }, { "name": "rm", + "symbol": [ + "SpaceTab" + ], "tip": [ "U: rm \n", "移除命令别名\n",