Can you replace user's input when using CompletionProposal?
まだ誰も着手していません。
評価
調査の方向性
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時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spring-projects/spring-shell のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
spring-projects/spring-shell#1391 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
spring-projects/spring-shell#1390 ·
-
type/enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
spring-projects/spring-shell#1383 · コメント 6 件 ·
-
area/dependencies type/enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
spring-projects/spring-shell#1213 · リアクション 1 件 ·
-
area/dependencies type/enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
spring-projects/spring-shell#1205 · コメント 1 件 ·
spring-projects/spring-shell の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
area/docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
BoxChart rejects valid List.of data with NullPointerException対応中かも @PHJ2000 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100