From d6af26d9a94cd4226cdd0a6b9adb9bedb910d761 Mon Sep 17 00:00:00 2001 From: abgox Date: Fri, 15 Nov 2024 22:37:40 +0800 Subject: [PATCH] feat(completions): update psc --- completions/psc/guid.txt | 2 +- completions/psc/hooks.ps1 | 18 ++++++++++++------ completions/psc/language/en-US.json | 2 +- completions/psc/language/zh-CN.json | 4 ++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/completions/psc/guid.txt b/completions/psc/guid.txt index 3c5f569..c19beab 100644 --- a/completions/psc/guid.txt +++ b/completions/psc/guid.txt @@ -1 +1 @@ -6b969328-ef06-44c4-b863-c3bb10aab7c7 +2dc97dd2-d731-4609-8799-e48d484b0831 diff --git a/completions/psc/hooks.ps1 b/completions/psc/hooks.ps1 index cdad016..a967e40 100644 --- a/completions/psc/hooks.ps1 +++ b/completions/psc/hooks.ps1 @@ -29,6 +29,7 @@ $completions += $PSCompletions.return_completion("completion $($completion) language $($language)", $PSCompletions.replace_content($PSCompletions.info.completion.language.tip_v)) } foreach ($c in $json.config) { + $config_item = $c.name $tip = $PSCompletions.replace_content($c.tip) -replace '<\@\w+>', '' if ($c.values) { $completions += $PSCompletions.return_completion("completion $($completion) $($c.name)", $tip, 'SpaceTab') @@ -39,15 +40,9 @@ else { $completions += $PSCompletions.return_completion("completion $($completion) $($c.name)", $tip) } - $config_item = $c.name - $completions += $PSCompletions.return_completion("reset completion $($completion) $($config_item)", $PSCompletions.replace_content($PSCompletions.info.reset.completion.tip_v)) } $completions += $PSCompletions.return_completion("reset alias $($completion)", $PSCompletions.replace_content($PSCompletions.info.reset.alias.tip)) - - - $symbol = if ($json.config) { 'SpaceTab' }else { '' } - $completions += $PSCompletions.return_completion("reset completion $($completion)", $PSCompletions.replace_content($PSCompletions.info.reset.completion.tip), $symbol) } foreach ($completion in $PSCompletions.list) { @@ -65,5 +60,16 @@ $completions += $PSCompletions.return_completion("menu custom color $($item) $($color)", $PSCompletions.replace_content($PSCompletions.info.menu.custom.color.tip)) } } + + foreach ($completion in $PSCompletions.data.config.comp_config.Keys) { + if ($PSCompletions.data.config.comp_config.$completion.Keys) { + $completions += $PSCompletions.return_completion("reset completion $($completion)", $PSCompletions.replace_content($PSCompletions.info.reset.completion.tip), 'SpaceTab' ) + + foreach ($config_item in $PSCompletions.data.config.comp_config.$completion.Keys) { + $completions += $PSCompletions.return_completion("reset completion $($completion) $config_item", $PSCompletions.replace_content($PSCompletions.info.reset.completion.tip_v)) + } + } + } + return $completions } diff --git a/completions/psc/language/en-US.json b/completions/psc/language/en-US.json index 66dca49..0e42402 100644 --- a/completions/psc/language/en-US.json +++ b/completions/psc/language/en-US.json @@ -1334,7 +1334,7 @@ "\n", "<@Blue>PSCompletions<@Cyan> will take up two global names.\n", " <@Magenta>PSCompletions<@Cyan> => A function name. The core function of the module export. (<@Magenta>psc<@Cyan> is actually its alias.)\n", - " <@Magenta>$PSCompletions<@Cyan> => A variable name. Save all information related to the module. (<@Yellow>You can't modify it.<@Cyan>)\n", + " <@Magenta>$PSCompletions<@Cyan> => A variable name. Save all data related to the module. (<@Yellow>You can't modify it.<@Cyan>)\n", "\n", "For more information, please visit the project:\n", " Website : <@Blue>https://pscompletions.pages.dev<@Cyan>\n", diff --git a/completions/psc/language/zh-CN.json b/completions/psc/language/zh-CN.json index c75ff30..6de8bb7 100644 --- a/completions/psc/language/zh-CN.json +++ b/completions/psc/language/zh-CN.json @@ -1334,7 +1334,7 @@ "\n", "<@Blue>PSCompletions<@Cyan> 模块只会占用两个全局命名\n", " <@Magenta>PSCompletions<@Cyan> => 函数名, 模块导出的核心函数(<@Magenta>psc<@Cyan> 其实就是它的别名)\n", - " <@Magenta>$PSCompletions<@Cyan> => 变量名, 存储模块相关的所有信息(<@Yellow>你不能修改它<@Cyan>)\n", + " <@Magenta>$PSCompletions<@Cyan> => 变量名, 存储模块相关的所有数据(<@Yellow>你不能修改它<@Cyan>)\n", "\n", "更多相关信息, 请访问:\n", " Website : <@Blue>https://pscompletions.pages.dev<@Cyan>\n", @@ -1849,7 +1849,7 @@ ] }, "completion": { - "tip": "重置(移除) {{ $completion }} 的所有特殊配置或指定特殊配置", + "tip": "重置(移除) {{ $completion }} 的所有特殊配置或指定的特殊配置", "tip_v": "重置(移除) {{ $completion }} 的特殊配置 --- {{ $config_item }}", "example": [ "E: psc reset completion * --- 重置(移除)所有补全的特殊配置\n",