which-sem: show all SemVer options with selected one highlighted#67
Conversation
Co-authored-by: Uliboooo <190558756+Uliboooo@users.noreply.github.com> Agent-Logs-Url: https://github.com/Uliboooo/ghost_git_writer/sessions/ffabb89f-b75c-43ef-8e73-5d79e2c3a29c
Uliboooo
left a comment
There was a problem hiding this comment.
Request Changes
SemVer parts (MAJOR/MINOR/PATCH) are a closed and invariant domain, but the current implementation models them as dynamic strings (SEM_VER_ITEMS, self.selected: String, position, to_lowercase, unwrap_or).
This weakens semantics and introduces unnecessary runtime logic for a fixed structure.
Reasons
- SemVer is a fixed structure and should be represented as an enum
- String-based lookup allows invalid states
unwrap_orsilently hides errors- The logic is more dynamic than the problem requires
Direction
- Introduce
enum SemVerPart { Major, Minor, Patch } - Replace string-based selection with
SemVerPart - Use
matchand minimal rendering logic - Remove string comparison and index search
Goal: explicit domain modeling with enum and minimal logic.
Co-authored-by: Uliboooo <190558756+Uliboooo@users.noreply.github.com> Agent-Logs-Url: https://github.com/Uliboooo/ghost_git_writer/sessions/17ca022d-9fdc-4803-adab-d8317bd9c139
Done in beea831.
|
Uliboooo
left a comment
There was a problem hiding this comment.
please update version info of Cargo.toml
sorry. i forgot order that update version info of Cargo.toml
This comment was marked as duplicate.
This comment was marked as duplicate.
4 similar comments
|
@Uliboooo The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@Uliboooo The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@Uliboooo The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
|
@Uliboooo The model You can try again without specifying a model (just If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: |
Uliboooo
left a comment
There was a problem hiding this comment.
please update version info of Cargo.toml
Co-authored-by: Uliboooo <190558756+Uliboooo@users.noreply.github.com> Agent-Logs-Url: https://github.com/Uliboooo/ghost_git_writer/sessions/82a76db2-83fc-472b-ace3-98bdc3bceff6
Done in 81123ff — bumped version from |
Uliboooo
left a comment
There was a problem hiding this comment.
why do you choose patch field?
Uliboooo
left a comment
There was a problem hiding this comment.
why do you choose patch field?
SemVerSelectorstruct tocli_helper.rsthat displays all three SemVer options with the selected one boxedmain.rsto useSemVerSelectorfor which-sem outputSemVerSelectorincli_helper.rsString-based selection withenum SemVerPart { Major, Minor, Patch }0.18.3inCargo.tomlOriginal prompt
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.