You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
背景
ctx.commands.register目前的 input 配置只接受{ hint: string }(dsh-commands/lib/index.js:138-148,且 Object.freeze)。命令名补全和
菜单中的 hint 提示已经很好用,但用户选中命令之后,参数部分没有任何
补全通道——只能靠 hint 文本提示语法,拼错了要等提交后才收到错误卡片。
实际场景
包管理器风格的命令参数词表是完全可枚举的。以我们的仓库管理插件为例:
这些词表都能廉价提供,但没有接口喂给输入 UI。用户实际会遇到:
输入
/ext skill install xxx(旧写法习惯)→ 提交 → 错误卡片告知正确语法。若输入过程中就有补全,这类错误在提交前就消失了。
建议
给 input 增加补全钩子,例如:
客户端输入 UI 在命令名匹配后、用户继续输入时调用,展示候选。
实现上需要考虑的细节:
<name...>语义下的逐词补全与空格插入;价值
命令面从"可发现"升级为"可操作"。对管理器类命令(plugin/ext/quota
等一切带名词表的命令),补全比错误提示的体验差距非常大。
All reactions