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 Aug 7, 2024
1 parent 761e2eb commit c15c536
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 336 deletions.
2 changes: 1 addition & 1 deletion completions/psc/guid.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ddc21150-3d05-4028-9ba0-3ecf628f2074
ee13bff5-b9b2-4d1f-8e26-2f5ed2152f56
189 changes: 25 additions & 164 deletions completions/psc/language/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -795,22 +795,22 @@
"name": "menu_tip_cover_buffer",
"symbol": "SpaceTab",
"tip": [
"Current Value: {{ $PSCompletions.config.menu_tip_cover_buffer }} (Default: 0, it means disabled.)\n",
"Current Value: {{ $PSCompletions.config.menu_tip_cover_buffer }} (Default: 1, it means enabled.)\n",
"Set whether to overwrite the original content of each line in the area where it is located and its neighboring areas when displaying a completion tip.\n",
"(Restores when exiting the complete menu)"
],
"next": [
{
"name": "0",
"tip": [
"Set to 0 (Default)\n",
"Set to 0\n",
"Only a small area of the content needed for display is overwritten."
]
},
{
"name": "1",
"tip": [
"Set to 1\n",
"Set to 1 (Default)\n",
"Overwrite the original content of each line in the area where it is located and its neighboring areas."
]
}
Expand Down Expand Up @@ -1223,79 +1223,28 @@
"If removed, it will be automatically added again."
]
},
"description": [
"<@Blue>PSCompletions(<@Magenta>psc<@Cyan>) --- PowerShell Completions Manager\n",
"Current module version: <@Magenta>{{ $PSCompletions.version }}<@Cyan>\n",
"Module version log: <@Blue>https://gitee.com/abgox/PSCompletions/blob/main/module/log.json<@Cyan>\n",
"desc": [
"<@Cyan>Current module version: <@Magenta>{{ $PSCompletions.version }}<@Cyan>\n",
"Module version log:\n",
" Github: <@Blue>https://github.com/abgox/PSCompletions/blob/main/module/CHANGELOG.md<@Cyan>\n",
" Gitee : <@Blue>https://gitee.com/abgox/PSCompletions/blob/main/module/CHANGELOG.md<@Cyan>\n",
"\n",
"About special symbol after the completion item:\n",
"- 😄🤔😎 : If there are multiple, you can choose the effect of one of them.\n",
"<@Blue>PSCompletions<@Cyan> is simple, you just need to enter <@Magenta>psc<@Cyan>, press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key, you will quickly learn all usages by reading the completion tip.\n",
"Now, enter <@Magenta>psc add<@Cyan>, press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key, and add the first completion!\n",
"\n",
" - 😄 : It means that after you apply it, you can press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get command completions.(Normal or optional completions)\n",
" - It can be customized by running <@Magenta>psc menu symbol SpaceTab <symbol><@Cyan>\n",
" - 🤔 : It means that after you apply it (option completion), you can press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get option completions. (e.g. --verbose)\n",
" - It can be customized by running <@Magenta>psc menu symbol OptionTab <symbol><@Cyan>\n",
" - 😎 : It means that after you apply it (option completion), you can press <@Magenta>Space<@Cyan> and enter a string, then press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get the rest of option completions.\n",
" - If the string has Spaces, Please use \"\" or '' to wrap it. e.g. 'test content'\n",
" - If there is also 😄, it means that there are some strings to complete, you can press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get command completions without entering a string.\n",
" - It can be customized by running <@Magenta>psc menu symbol WriteSpaceTab <symbol><@Cyan>\n",
" - Completion of generic options can also be triggered if there is one or more generic option completion.\n",
" - All complements can be triggered by pressing the <@Magenta>Tab<@Cyan> key after entering a part.\n",
" - If you don't need or want to see these symbols, you can hide them by replacing them with the empty string.\n",
" - e.g. <@Magenta>psc menu symbol SpaceTab \"\"<@Cyan>\n",
"\n",
"- When using the completion menu provided by PowerShell, if <@Magenta>...<@Cyan> is the last completion item, which means that the display area is too small to display all completion items.\n",
"- When using the completion menu provided by PSCompletions module, if <@Magenta>...<@Cyan> appears at the end of the completion tip, which means that the width of the display area is too narrow and the tip display is not completed.\n",
"\n",
"About completion tip:\n",
" - Completion tip is only a helper, you can also hide the tip by running <@Magenta>psc menu config menu_show_tip 0<@Cyan>\n",
" - General structure of the completion tip: <@Magenta>Usage<@Cyan> + <@Magenta>Description<@Cyan> + <@Magenta>Example<@Cyan>\n",
"------------- Tip Example --------------\n\n",
"U: install|add [-g|-u] [options] <app> \n",
"This is a description of the command.\n",
"E: install xxx\n",
" add -g xxx\n\n",
"----------------------------------------\n",
"- Example Analysis:\n",
" 1. Usage: Begin with <@Magenta>U: <@Cyan>\n",
" - command name: <@Magenta>install<@Cyan>\n",
" - command alias: <@Magenta>add<@Cyan>\n",
" - required parameters: <@Magenta><app><@Cyan>\n",
" - The values in <> are a simple summary of the parameters.\n",
" - optional parameters: <@Magenta>-g<@Cyan> <@Magenta>-u<@Cyan>\n",
" - [options] : Some options\n",
" 2. Description: The description of the command\n",
" 3. Example: Begin with <@Magenta>E: <@Cyan>\n",
"\n",
"About completion menu provided by PSCompletions module:\n",
"- It can only be used in PowerShell(pwsh) under Windows.\n",
"- Some keys in the completion menu provided by the module.\n",
" 1. Apply the selected completion item: <@Magenta>Enter<@Cyan>\n",
" 2. Delete filter characters: <@Magenta>Backspace<@Cyan>\n",
" 3. Exit the completion menu: <@Magenta>ESC<@Cyan>/<@Magenta>Ctrl + c<@Cyan>\n",
" - When there are no characters in the filter area, you can also press <@Magenta>Backspace<@Cyan> key to exit the completion menu.\n",
" 4. Select completion item: \n",
" ┌───────────────┬───────────────┐\n",
" │ Previous Item │ Next Item │\n",
" │ <@Magenta>Up<@Cyan> │ <@Magenta>Down<@Cyan> │\n",
" | <@Magenta>Left<@Cyan> │ <@Magenta>Right<@Cyan> │\n",
" │ <@Magenta>Shift + Tab<@Cyan> │ <@Magenta>Tab<@Cyan> │\n",
" │ <@Magenta>Shift + Space<@Cyan> │ <@Magenta>Space<@Cyan> │\n",
" │ <@Magenta>Ctrl + u<@Cyan> │ <@Magenta>Ctrl + d<@Cyan> │\n",
" │ <@Magenta>Ctrl + p<@Cyan> │ <@Magenta>Ctrl + n<@Cyan> │\n",
" └───────────────┴───────────────┘\n",
"- All configurations of it, you can trigger completion by running <@Magenta>psc menu<@Cyan>, then learn about them by completion tip.\n",
"\n",
"About other information of PSCompletions module:\n",
"PSCompletions will take up two global names. (<@Yellow>You shouldn't modify them<@Cyan>)\n",
" <@Magenta>$PSCompletions<@Cyan> => A variable name. Used to save all information related to the module.\n",
" <@Magenta>PSCompletions<@Cyan> => A function name. The core function of the module export. (<@Magenta>psc<@Cyan> is actually its alias.)\n",
"<@Blue>PSCompletions<@Cyan> will take up two global names. (<@Yellow>You can't modify them.<@Cyan>)\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.\n",
"\n",
"For more information, please visit the project:\n",
" Github: <@Blue>https://github.com/abgox/PSCompletions\n<@Cyan>",
" Gitee : <@Blue>https://gitee.com/abgox/PSCompletions\n<@Cyan>",
"When you have a problem using it, you should submit an issue. ( https://github.com/abgox/PSCompletions/issues )\n",
"If the project is helpful to you, please consider giving it a <@Yellow>Star<@Cyan>.\n"
" Github: <@Blue>https://github.com/abgox/PSCompletions<@Cyan>\n",
" Gitee : <@Blue>https://gitee.com/abgox/PSCompletions<@Cyan>\n",
"When you have a problem using it, you can submit an issue. https://github.com/abgox/PSCompletions/issues\n",
"If <@Blue>PSCompletions<@Cyan> is helpful to you, please consider giving it a <@Yellow>Star<@Cyan>.\n"
],
"description": [
"<@Blue>PSCompletions(<@Magenta>psc<@Cyan>) --- PowerShell Completions Manager Module\n",
"{{ $info.desc }}"
],
"init_info": [
"\n<@Yellow>PSCompletions module install warning (The display is initialized for the first time only):\n",
Expand All @@ -1309,77 +1258,7 @@
"---------------------------------------------------------------------\n",
"<@Cyan>✨✨✨PSCompletions(<@Magenta>psc<@Cyan>) --- init successfully!✨✨✨\n",
"<@Yellow>The following is displayed for the first time only, you can also see it by running <@Magenta>psc<@Yellow><@Cyan>\n",
"Current module version: <@Magenta>{{ $PSCompletions.version }}<@Cyan>\n",
"Module version log: <@Blue>https://gitee.com/abgox/PSCompletions/blob/main/module/log.json<@Cyan>\n",
"\n",
"About special symbol after the completion item:\n",
"- 😄🤔😎 : If there are multiple, you can choose the effect of one of them.\n",
"\n",
" - 😄 : It means that after you apply it, you can press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get command completions.(Normal or optional completions)\n",
" - It can be customized by running <@Magenta>psc menu symbol SpaceTab <symbol><@Cyan>\n",
" - 🤔 : It means that after you apply it (option completion), you can press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get option completions. (e.g. --verbose)\n",
" - It can be customized by running <@Magenta>psc menu symbol OptionTab <symbol><@Cyan>\n",
" - 😎 : It means that after you apply it (option completion), you can press <@Magenta>Space<@Cyan> and enter a string, then press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get the rest of option completions.\n",
" - If the string has Spaces, Please use \"\" or '' to wrap it. e.g. 'test content'\n",
" - If there is also 😄, it means that there are some strings to complete, you can press <@Magenta>Space<@Cyan> and <@Magenta>Tab<@Cyan> key to continue to get command completions without entering a string.\n",
" - It can be customized by running <@Magenta>psc menu symbol WriteSpaceTab <symbol><@Cyan>\n",
" - Completion of generic options can also be triggered if there is one or more generic option completion.\n",
" - All complements can be triggered by pressing the <@Magenta>Tab<@Cyan> key after entering a part.\n",
" - If you don't need or want to see these symbols, you can hide them by replacing them with the empty string.\n",
" - e.g. <@Magenta>psc menu symbol SpaceTab \"\"<@Cyan>\n",
"\n",
"- When using the completion menu provided by PowerShell, if <@Magenta>...<@Cyan> is the last completion item, which means that the display area is too small to display all completion items.\n",
"- When using the completion menu provided by PSCompletions module, if <@Magenta>...<@Cyan> appears at the end of the completion tip, which means that the width of the display area is too narrow and the tip display is not completed.\n",
"\n",
"About completion tip:\n",
" - Completion tip is only a helper, you can also hide the tip by running <@Magenta>psc menu config menu_show_tip 0<@Cyan>\n",
" - General structure of the completion tip: <@Magenta>Usage<@Cyan> + <@Magenta>Description<@Cyan> + <@Magenta>Example<@Cyan>\n",
"------------- Tip Example --------------\n\n",
"U: install|add [-g|-u] [options] <app> \n",
"This is a description of the command.\n",
"E: install xxx\n",
" add -g xxx\n\n",
"----------------------------------------\n",
"- Example Analysis:\n",
" 1. Usage: Begin with <@Magenta>U: <@Cyan>\n",
" - command name: <@Magenta>install<@Cyan>\n",
" - command alias: <@Magenta>add<@Cyan>\n",
" - required parameters: <@Magenta><app><@Cyan>\n",
" - The values in <> are a simple summary of the parameters.\n",
" - optional parameters: <@Magenta>-g<@Cyan> <@Magenta>-u<@Cyan>\n",
" - [options] : Some options\n",
" 2. Description: The description of the command\n",
" 3. Example: Begin with <@Magenta>E: <@Cyan>\n",
"\n",
"About completion menu provided by PSCompletions module:\n",
"- It can only be used in PowerShell(pwsh) under Windows.\n",
"- Some keys in the completion menu provided by the module.\n",
" 1. Apply the selected completion item: <@Magenta>Enter<@Cyan>\n",
" 2. Delete filter characters: <@Magenta>Backspace<@Cyan>\n",
" 3. Exit the completion menu: <@Magenta>ESC<@Cyan>/<@Magenta>Ctrl + c<@Cyan>\n",
" - When there are no characters in the filter area, you can also press <@Magenta>Backspace<@Cyan> key to exit the completion menu.\n",
" 4. Select completion item: \n",
" ┌───────────────┬───────────────┐\n",
" │ Previous Item │ Next Item │\n",
" │ <@Magenta>Up<@Cyan> │ <@Magenta>Down<@Cyan> │\n",
" | <@Magenta>Left<@Cyan> │ <@Magenta>Right<@Cyan> │\n",
" │ <@Magenta>Shift + Tab<@Cyan> │ <@Magenta>Tab<@Cyan> │\n",
" │ <@Magenta>Shift + Space<@Cyan> │ <@Magenta>Space<@Cyan> │\n",
" │ <@Magenta>Ctrl + u<@Cyan> │ <@Magenta>Ctrl + d<@Cyan> │\n",
" │ <@Magenta>Ctrl + p<@Cyan> │ <@Magenta>Ctrl + n<@Cyan> │\n",
" └───────────────┴───────────────┘\n",
"- All configurations of it, you can trigger completion by running <@Magenta>psc menu<@Cyan>, then learn about them by completion tip.\n",
"\n",
"About other information of PSCompletions module:\n",
"PSCompletions will take up two global names. (<@Yellow>You shouldn't modify them<@Cyan>)\n",
" <@Magenta>$PSCompletions<@Cyan> => A variable name. Used to save all information related to the module.\n",
" <@Magenta>PSCompletions<@Cyan> => A function name. The core function of the module export. (<@Magenta>psc<@Cyan> is actually its alias.)\n",
"\n",
"For more information, please visit the project:\n",
" Github: <@Blue>https://github.com/abgox/PSCompletions\n<@Cyan>",
" Gitee : <@Blue>https://gitee.com/abgox/PSCompletions\n<@Cyan>",
"When you have a problem using it, you should submit an issue. ( https://github.com/abgox/PSCompletions/issues )\n",
"If the project is helpful to you, please consider giving it a <@Yellow>Star<@Cyan>.\n"
"{{ $info.desc }}"
],
"err": {
"network": [
Expand Down Expand Up @@ -1420,27 +1299,9 @@
" }",
"}",
"}}\n",
"<@Cyan>Press <@Magenta>Enter<@Cyan> key to update!"
"<@Cyan>Press <@Magenta>Enter<@Cyan> key to update or <@Magenta>other key<@Cyan> to cancel!"
],
"updating": "<@Cyan>Successfully run the command: <@Magenta>Update-Module PSCompletions\n<@Cyan>Updating PSCompletions module...",
"update_done": "<@Green>PSCompletions module update completed.Please restart the PowerShell and re-import the module",
"update_err": [
"<@Red>PSCompletions module update failed.\n",
"<@Yellow>Possible reasons for failure:\n",
"1. Network issue.\n",
"2. If you used the scoop package manager to install PSCompletions, you should also use scoop to update it.(<@Magenta>scoop update PSCompletions<@Yellow>)\n",
"3. Permissions issue, In version 4.0.0+, you must install with user permissions.(<@Magenta>-Scope CurrentUser<@Yellow>)\n",
" - Permission issue for upgrading modules from v3.x.x to v4.x.x in Windows PowerShell(powershell)\n",
" - If you are using Windows PowerShell(powershell) and are updating modules, you should first remove all PSCompletions modules from your computer.\n",
" - Then use <@Magenta>Install-Module PSCompletions -Scope CurrentUser<@Yellow> to install the latest version of PSCompletions module.\n",
" - <@Magenta>-Scope CurrentUser<@Yellow> is required, <@Red> cannot use '-Scope AllUser'<@Yellow>\n",
" - In PowerShell(pwsh), the module was previously installed using <@Magenta>Install-Module PSCompletions -Scope AllUser<@Yellow>, causing a problem with module directory permissions.\n",
" - You should delete this module. (or move it somewhere else for backup.)\n",
" - Then use <@Magenta>Install-Module PSCompletions -Scope CurrentUser<@Yellow> to install the latest version of PSCompletions module.\n",
" - <@Magenta>-Scope CurrentUser<@Yellow> is required, <@Red> cannot use '-Scope AllUser'<@Yellow>\n",
" - You are free to handle width the previously backed up module directory.\n",
"4. For other reasons, please submit an issue. ( https://github.com/abgox/PSCompletions/issues )\n"
]
"updating": "<@Cyan>Successfully run the command: <@Magenta>Update-Module PSCompletions\n<@Cyan>Updating PSCompletions module..."
},
"update_info": [
"<@Cyan>PSCompletions remote repository update:\n",
Expand Down Expand Up @@ -1536,7 +1397,7 @@
],
"no": [
"<@Red>Completion <@Magenta>{{ $completion }}<@Red> does not exist in the completions list.\n",
"It's recommended to type <@Magenta>psc add<@Red>, then press <@Magenta>Space<@Red> and <@Magenta>Tab<@Red> to complete.\n",
"It's recommended to enter <@Magenta>psc add<@Red>, then press <@Magenta>Space<@Red> and <@Magenta>Tab<@Red> to complete.\n",
"Or you can use <@Magenta>psc search<@Red> to search for available completions."
]
}
Expand Down
Loading

0 comments on commit c15c536

Please sign in to comment.