Skip to content

Commit

Permalink
feat(completions): update psc
Browse files Browse the repository at this point in the history
  • Loading branch information
abgox committed Nov 15, 2024
1 parent 8f398d8 commit d6af26d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion completions/psc/guid.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6b969328-ef06-44c4-b863-c3bb10aab7c7
2dc97dd2-d731-4609-8799-e48d484b0831
18 changes: 12 additions & 6 deletions completions/psc/hooks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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) {
Expand All @@ -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
}
2 changes: 1 addition & 1 deletion completions/psc/language/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions completions/psc/language/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -1849,7 +1849,7 @@
]
},
"completion": {
"tip": "重置(移除) {{ $completion }} 的所有特殊配置或指定特殊配置",
"tip": "重置(移除) {{ $completion }} 的所有特殊配置或指定的特殊配置",
"tip_v": "重置(移除) {{ $completion }} 的特殊配置 --- {{ $config_item }}",
"example": [
"E: psc reset completion * --- 重置(移除)所有补全的特殊配置\n",
Expand Down

0 comments on commit d6af26d

Please sign in to comment.