Skip to content

Commit

Permalink
feat(module): update version to 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abgox committed Aug 7, 2024
1 parent c15c536 commit e599630
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 359 deletions.
1 change: 0 additions & 1 deletion module/.version

This file was deleted.

101 changes: 101 additions & 0 deletions module/CHANGELOG-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<p align="center">
<a href="./CHANGELOG.md">English</a> |
<a href="./CHANGELOG-CN.md">简体中文</a>
</p>

## 4.1.0 (2024/8/7)

- 现在 `Windows PowerShell` 也可以使用模块提供的补全菜单了
- 不过由于渲染问题,补全菜单的边框样式无法自定义
- 修复一些其他问题
- 调整源代码文件目录结构
- 整理代码

## 4.0.9 (2024/7/20)

- 添加两个命令: 添加/移除所有补全
- `psc add *`
- `psc rm *`
- 优化 `common_options` 的逻辑处理
- 修复模块更新的问题
- 调整源代码文件目录结构
- 整理代码

## 4.0.7 (2024/7/6)

-`ForEach-Object` 替换为 `foreach`
- `ForEach-Object` 在一些特殊情况下的结果不符合预期
- 整理代码

## 4.0.6 (2024/5/20)

- 一个默认颜色配置改错了,修复一下

## 4.0.5 (2024/5/20)

- 修复了关于补全特殊配置的一些问题
- 修复了因为存在缓存导致配置修改后无法立即生效的问题
-`reset` 命令添加 `completion` 子命令,用于重置(移除)补全的特殊配置
- 修复了一些其他问题

## 4.0.4 (2024/5/20)

- 修复了当补全列表滚动时,补全提示信息、过滤区域、状态区域闪烁的问题
- 修复了一些其他的小问题

## 4.0.3 (2024/5/18)

- 修复了一个因为修改终端输出编码导致提示信息显示错误的问题
- 必须先导入 `PSCompletions` 模块,然后再修改终端输出编码,否则还是会显示错误
-`menu_tip_cover_buffer` 这个配置的默认值从 `0` 修改为 `1`
- 表示默认情况下,菜单提示信息会覆盖缓冲区内容,主要是当提示信息显示在上方时,会覆盖掉上方所有内容,这会看起来背景更简洁
- 当然,当补全菜单消失后,覆盖的内容会恢复
- 你也可以禁用它(`psc menu config menu_tip_cover_buffer 0`)
- 修复了一些其他的小问题

## 4.0.2 (2024/5/15)

- 一个测试环境的配置没有及时删除,修复一下

## 4.0.1 (2024/5/15)

- 一个默认配置的颜色写错了,修复一下

## 4.0.0 (2024/5/15)

- 如果你当前使用的 `PSCompletions` 模块需要**管理员权限**,你应该删除 `PSCompletions` 模块,然后以**用户权限**安装最新版的模块。

- 完整的模块安装命令: `Install-Module PSCompletions -Scope CurrentUser`

- 4.0.0 版本重构了整个模块,解决了许多不合理的地方,所以完全不兼容旧版本的配置和补全

1. 性能优化:
- 提升了模块加载速度
- 提升了补全响应速度
2. 补全菜单:
- 补全菜单完全重写,菜单渲染的稳定性大幅提高,从根本上解决了许多渲染 bug
- 补全菜单新增了许多的配置项,你可以自行通过触发补全以及提示信息查看
- 比如: `menu_show_tip`, 它可以控制补全提示信息是否显示,如果你对命令足够熟悉,建议禁用补全提示信息
- 此配置也可以单独给某一个补全设置,参考 `psc completion` 下的命令
3. 补全别名:
- 现在补全别名支持多个,你可以随意添加。理论上,你可以添加无数个别名
- 比如,你可以添加 `.\scoop.ps1` 这样的别名,这在有些时候比较有用
4. 补全文件和模块解耦
- 现在可以只编写 json 文件去新增/更新/翻译一个补全,不需要涉及到代码(如果需要使用到 hooks 除外)
- 同时使用了 json schema 控制 json 文件的类型,这让想要为仓库添加补全的贡献者创建 PR 的难度大幅降低
- 比如你觉得某一个命令的描述不够完善,你也可以修改它的 json 文件后之后,提交一个 PR
5. 语言:
- 现在从模块层面,支持任何语言,模块会根据语言配置以及每一个补全的 `config.json` 文件来决定语言
- 这意味着以后可以添加更多语言的支持,只需要编写对应的 json 文件即可
6. 其他:
- 新增了一些按键映射,你现在可以通过许多种按键方式在补全菜单中选择补全项,你可以选择一种适合自己的。
|选择上一项|选择下一项|
|:-:|:-:|
|`Up`|`Down`|
|`Left`|`Right`|
|`Shift + Tab`|`Tab`|
|`Shift + Space`|`Space`|
|`Ctrl + u`|`Ctrl + d`|
|`Ctrl + p`|`Ctrl + n`|
- 现在符号被放在了补全项的后面,补全提示信息中不再出现符号
- ...
101 changes: 101 additions & 0 deletions module/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<p align="center">
<a href="./CHANGELOG-CN.md">简体中文</a>|
<a href="./CHANGELOG.md">English</a>
</p>

## 4.1.0 (2024/8/7)

- Now `Windows PowerShell` can use the completion menu provided by `PSCompletions`.
- But, due to rendering problems, the border style of the completion menu cannot be customized.
- Fix some other issues.
- Change the directory structure of the source code file.
- Clean up the code.

## 4.0.9 (2024/7/20)

- Add two commands: add/remove all completions.
- `psc add *`
- `psc rm *`
- Optimize the logic processing of `common_options`.
- Fix the problem of module update.
- Change the directory structure of the source code file.
- Clean up the code.

## 4.0.7 (2024/7/6)

- Replace `ForEach-Object` with `foreach`.
- `ForEach-Object` has unexpected results in some special cases.
- Clean up some code

## 4.0.6 (2024/5/20)

- A default configuration color was mistakenly written, fix it.

## 4.0.5 (2024/5/20)

- Fix some issues about the special configurations of completion.
- Fix an issue where configuration changes did not take immediate effect due to caching.
- Add the `completion` subcommand to the `reset` command to reset (remove) the special configuration of completion.
- Fix some other issues.

## 4.0.4 (2024/5/20)

- Fix a bug where the completion tip area, filter area and status area flashes when scrolling the completion list.
- Fix some other minor issues.

## 4.0.3 (2024/5/18)

- Fix a bug where the completion tip was displayed incorrectly because the terminal output encoding was modified.
- You must import the `PSCompletions` module first, and then modify the terminal output encoding. Otherwise, it will still display incorrectly.
- Change the default value of `menu_tip_cover_buffer` from `0` to `1`.
- This configuration means that the completion tip will cover the buffer content by default, which is mainly when the completion tip is displayed above, it will cover all the buffer content above, which will make the background look cleaner.
- Of course, the buffer content covered by the completion tip will be restored when the completion menu exits.
- You can disable it by running `psc menu config menu_tip_cover_buffer 0`.
- Fix some other minor issues.

## 4.0.2 (2024/5/15)

- A test environment configuration was not deleted, fix it.

## 4.0.1 (2024/5/15)

- A default configuration color was mistakenly written, fix it.

## 4.0.0 (2024/5/15)

- If you are using the `PSCompletions` module with **administrator permission**, you should remove the `PSCompletions` module and install the latest version with **user permission**.

- Full module installation command: `Install-Module PSCompletions -Scope CurrentUser`

- This version completely rewrites the module, and solves many inappropriate places, so it's completely incompatible with the old version configuration and completion.
1. Performance optimization:
- Improve module loading speed.
- Improve completion response speed.
2. Completion menu:
- Completely rewrite the completion menu, which greatly improves the stability of the menu rendering, and solves many rendering bugs from the root.
- The completion menu now has many configuration items, you can trigger completion by running `psc menu`, then learn about them by completion tip.
- For example: `menu_show_tip`, which can control whether the completion tip is displayed.
- If you are familiar with the command, it's recommended to disable the completion tip.
- This configuration can also be set separately for each completion, refer to `psc completion` for command.
3. Completion alias:
- Now completion alias supports multiple, you can add as many as you like. Theoretically, you can add an infinite number of aliases.
- For example, you can add `.\scoop.ps1` as an alias, which can be useful in some cases.
4. Decoupling of completion file and module.
- Add/update/translate completions now doesn't involve module core code. (Except if hooks are needed.)
- Use json schema to control the type of json file, which makes it easier for contributors to create PR for the completion repository.
- For example, if you think the description of a command is not good, you can modify its json file and create a PR.
5. Language:
- Now the module supports any language, and the module determines the language based on the language configuration and each completion's config.json file.
- It means that more languages can be supported in the future by simply writing the corresponding json file.
6. Other:
- Added some key mappings, which allows you to select completion items in the completion menu using various key combinations. You can choose one that suits you.
|Select previous item|Select next item|
|:-:|:-:|
|`Up`|`Down`|
|`Left`|`Right`|
|`Shift + Tab`|`Tab`|
|`Shift + Space`|`Space`|
|`Ctrl + u`|`Ctrl + d`|
|`Ctrl + p`|`Ctrl + n`|
- The symbol is now placed behind the completion item, and the symbol is no longer displayed in the completion tip.
- ...
2 changes: 1 addition & 1 deletion module/PSCompletions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

RootModule = 'PSCompletions.psm1'

ModuleVersion = '4.0.9'
ModuleVersion = '4.1.0'

GUID = '00929632-527d-4dab-a5b3-21197faccd05'

Expand Down
5 changes: 3 additions & 2 deletions module/PSCompletions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function PSCompletions {
}
$PSCompletions.show_with_less_table($data, ('Completion', 'Alias', $max_len))
}

function Out-Config {
$PSCompletions.config | ConvertTo-Json | Out-File $PSCompletions.path.config -Force -Encoding utf8
}
Expand Down Expand Up @@ -575,7 +574,7 @@ function PSCompletions {
$PSCompletions.config.menu_color_selected_back = 'DarkGray'
$PSCompletions.config.menu_color_filter_text = 'Yellow'
$PSCompletions.config.menu_color_filter_back = 'Black'
$PSCompletions.config.menu_color_border_text = 'Gray'
$PSCompletions.config.menu_color_border_text = 'DarkGray'
$PSCompletions.config.menu_color_border_back = 'Black'
$PSCompletions.config.menu_color_status_text = 'Blue'
$PSCompletions.config.menu_color_status_back = 'Black'
Expand Down Expand Up @@ -874,6 +873,8 @@ function PSCompletions {
if (!$no_show_msg) { $PSCompletions.write_with_color((_replace $PSCompletions.info.reset.done)) }
}
function _help {
$json = $PSCompletions.data.psc
$info = $PSCompletions.info
$PSCompletions.write_with_color((_replace $PSCompletions.info.description))
}
$need_init = $true
Expand Down
Loading

0 comments on commit e599630

Please sign in to comment.