Vibe code create Key show typeclass#31
Merged
noelwelsh merged 4 commits intocreativescala:mainfrom May 2, 2025
Merged
Conversation
Show for pretty-printing a keystroke. Can be used for debugging applications, showing keystrokes. PR made with help from Claude Code.
noelwelsh
reviewed
Apr 29, 2025
| } | ||
| case KeyCode.F(value) => s"F$value" | ||
| case KeyCode.Unknown(code) => s"Unknown($code)" | ||
| case other => other.toString.replaceAll("^[^.]*\\.", "") |
Contributor
There was a problem hiding this comment.
I don't think this regex does anything useful. (I don't think it actually does anything at all, as the toString doesn't contain any dot-separated prefix. E.g. Key.pageUp.code.toString is PageUp.)
Contributor
Author
There was a problem hiding this comment.
Yeah, I was wondering how it came about. It looks like the LLM expected the canonical name?
noelwelsh
requested changes
Apr 29, 2025
Contributor
noelwelsh
left a comment
There was a problem hiding this comment.
I'd like to see the regex justified or removed before merging this.
Regex did not perform any function.
Made additional changes for simplification and readability.
Contributor
Author
Fixed and made a couple more tweaks that I think are simpler and easier to read. |
Contributor
|
Looks good! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR creates a cats
Showinstance forKeyto make debugging individual key strokes. I've wanted to make this for a while, but it felt like it was mostly boiler plate and not very interesting to actually write. This morning I decided to give things a go with Claude Code to see if I could bang it out in a hurry and was pleasantly surprised. The whole interaction took around 12 minutes and cost around $0.40 in credits.Open to making any changes, but I wanted to show the raw output first.
I've included the entire interaction with Claude Code for the curious: