Can you replace user's input when using CompletionProposal?
还没有人认领这个 Issue。
评估
调研方向
Start by inspecting CompletionProposal and its displayText, category, and description methods. Determine how completion matching and replacement currently use the proposal text. Done means search terms such as enum properties or descriptive names can select a proposal while replacing the input with its final value and showing a clear label to the user.
由索引模型根据 Issue 内容生成。
描述
Let's say the options are an enum of DayOfWeek; and each day has an associated number and color (just for the sake of an example).
public enum DayOfWeek {
MONDAY(0, "yellow"),
TUESDAY(1, "blue"),
WEDNESDAY(2, "pink"),
THURSDAY(3, "purple"),
FRIDAY(4, "orange"),
SATURDAY(5, "green"),
SUNDAY(6, "red");
public int num;
public String color;
public DayOfWeek(int num, String color) {
this.num = num;
this.color = color;
}
public static List<CompletionProposal> completion() {
return Arrays.stream(values()).map(Enum::name).map(CompletionProposal::new).toList();
}
}
I want the user to get autocomplete with all the properties, in addition to the enum name.
If I give the List<CompletionProposal> of the names of the enum constants, this will work:
MON -> MONDAY
What if I want the user to type gre or green and then have it change to SATURDAY?
Even if that is not possible, what if I type satur? It won't autocomplete to SATURDAY or saturday, unless I include the day twice as upper and lower cases, which is confusing to the user.
The only way I can think of showing it to the user is to use the displayText, category, or description method to the user, but it's still a chore to type exactly the words.
In my case I have IDs of a huge list, and the user won't remember the entire IDs of the list, so I would like them to autocomplete with a sort of a "search" feature. Let's say I type "Mark Twain" or "Tom Sawyer", I want to get "94782293" to replace the words I typed, since the final value will be an ID, but the other words help search. So far I'm using displayText as Tom Sawyer by Mark Twain: 94782293, but the value is 94782293, which is obscuring what's happening to the user.
- 主要语言
- Java
- 星标
- 826
- 派生
- 404
- 平均合并
- 6 天 9 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spring-projects/spring-shell 的其他 Issue
-
NonInteractiveShellRunner, wrong exit value when Commands cannot be parsed可能已有人在做 @czpilar 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
spring-projects/spring-shell#1391 · 2 条评论 ·
-
Options validation error messages in non-interactive mode可能已有人在做 @czpilar 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
spring-projects/spring-shell#1390 · 1 条评论 ·
-
ShellInputProvider inputs are not consumed by `ComponentFlow`-based interactive components (e.g. `ConfirmationInput`, `StringInput`)可能已有人在做 @czpilar 于 13 天前认领。 未关闭type/enhancement
难度 3/5 1-2 天 新手友好度 68/100
spring-projects/spring-shell#1383 · 6 条评论 ·
-
area/dependencies type/enhancement
难度 5/5 一周以上 新手友好度 25/100
spring-projects/spring-shell#1213 · 1 个 reaction ·
-
Revisit dependency to Spring Messaging可能已有人在做 @piotrooo 于 288 天前认领。 未关闭area/dependencies type/enhancement
难度 5/5 一周以上 新手友好度 25/100
spring-projects/spring-shell#1205 · 1 条评论 ·
查看 spring-projects/spring-shell 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
jenkinsci/ec2-plugin#2041 ·
-
L: github:actions L: php:composer
难度 2/5 1-3 小时 新手友好度 88/100
dependabot/dependabot-core#16493 ·
维护者通常 1 天内回复
-
SHOW EDIT of a subclass for an object of its superclass: the form fails to open with AssertionError未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 1/5 1 小时以内 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 78/100
FlashyReese/sodium-extra#608 ·