Below you will find pages that utilize the taxonomy term “Kotlin”
Implementing a Fuzzier font option using Junie
Collaborating with Junie on implementing font family setting for Fuzzier
On the last PR I let Junie handle all coding. On this one I use my normal collaborative workflow.
- Junie: Initial setup - Added the new setting and created tests (normally copy-paste work for me)
- Junie: API work - Handled the editor font API call (would’ve been googling/doc-reading for me)
- Me: Review & refactor - Went through the changes, tested functionality and did some refactoring
- Junie: Code review - Suggested improvements (null safety, caching)
- Both: Implementation - Applied the improvements together
- Me: Documentation - Updated docs and some minor tweaks (wording etc.)
Implementing a config feature to Fuzzier using Junie
Junie implementing global exclusions
I let Junie implement a new feature to Fuzzier. Here are some thoughts about that.
You can checkout the full PR below. I only wrote the changelog, but all other changes were made by Junie.
It’s not that simple
Evaluating pros and cons of AI is hard (for me).
Prompting
Nothing special going on.
The whole process took 3 separate tasks
Performance testing an IntelliJ plugin with JMH
Performance testing Fuzzier
The time has finally come. I want to create some performance metrics for Fuzzier.
Fuzzier is a file finder plugin for JetBrains editors inspired by Telescope for Nvim that I've been developing for a little over a year now.
First, I need a plan. Fuzzier is written in Kotlin and I'm a Java developer, so I'll be leaning into the tools that I know.
Refactoring a large part of an IntelliJ plugin
Refactoring Fuzzier score calculation
Why would I do that?
I've been working with Fuzzier for over four months now, and it is getting closer to being at 1.0/feature ready. With good amount of other things and QoL changes done since its inception.
The file path and search string comparison/score calculation is one likely the most important feature of the plugin. Having the ability to tweak and modify the search results, so it works the best for each of us is important when using a file finder.
An article about creating a relatively simple IntelliJ IDEA plugin
Creating an IntelliJ Plugin
What's missing from IntelliJ
Lately I've been checking out some videos from The Primeagen and was inspired to get back into vim. Although I'm not ready to give up IntelliJ IDEA, I set up the IdeaVim plugin two months ago and I'm still loving it.
I was curious about NeoVim and decided to follow The Primeagen's video 0 to LSP : Neovim RC From Scratch. I absolutely loved how the telescope search works and it became really clear that the double shift (or CTRL + SHIFT + n) file search in IntelliJ does not support fuzzy search nor include the project file path in the search. After spending almost five minutes to check the marketplace for a fuzzy search plugin, I already knew the answer; I wanted to make a plugin that feels and looks more like Telescope for Nvim.
Attempted agentic migration
Migrating from Mockito to MockK
Iteration 1
OkayPrompt
Lets migrate from mockito to mockk because this is a kotlin projectResult
Actually took the right steps for the update:
- Replaced the dependency
- Migrated Mockito calls
But couldn’t solve coroutine version conflict between platform libs and MockK.
Iteration 2
Not goodPrompt
There are failing testsResult
It tried to bring in another version of coroutines and tried to ensure that system JNA wouldn’t be used. This only made things worse.Conclusion
Honestly my prompting wasn’t the best, but this was supposed to be a simple migration. The agent took a long time running this task and I don’t think it was worth it.
Generating UI tests with copilot
Test generation for file type globbing
Iteration 1
GoodPrompt
Implement tests for this class (included FuzzyFinderComponent.kt)Result
Copilot generated the following tests:
- 4 tests verifying the orientation based on the search field location
- Default dimensions are followed as expected
- Secondary text field listener is added and works as expected
The test setup wasn’t working, though the error might be coming from my code.
Implementing a search improvement using Junie
Fuzzier ripgrep file type globbing
Iteration 1
GoodPrompt
Let’s make a modification to FuzzyGrep and FuzzyFinderComponent:
When FuzzyGrep is using ripgrep (rg) command, add a new field to the component. It should be located on the right side of the main search field and share the same container
When in doubt, ask me for clarifications!
Result
The actual field implementation was fine, didn’t remember to say that don’t comment every line (why is this still a thing?)Iteration 2
GoodPrompt
Remove the unnecessary comments that you’ve added and make the new field around the size of a single wordResult
Comments are gone, but when trying to limit the size, it fucked up the actual field dimensionsTODO: Image here
Implementing preview improvement for Fuzzier using Junie
Up/down navigation for preview
Iteration 1
ExcellentPrompt
Add CTRL + D and CTRL + U keybindings to the main and secondary search field in FuzzyFinderComponentResult
Nothing to complain about, it also included a working action, which moves half page on the result list.
Even though it overreached, I think the result warrants an excellent grade.
Iteration 2
ExcellentPrompt
Implement the functionmovePreviewHalfPage for FuzzyFinderComponent
Result
Yup, easy as that.Iteration 3
OkayPrompt
Create simple tests for the listeners created at setupCtrlDUShortcutsResult
Too much complexity, but I did see that coming.Updating deprecated calls using Junie
Fix deprecated document listener calls
Iteration 1
Not goodPrompt
Fix TestBenchComponent addDocumentListener call
document.addDocumentListener(listener, project)
The call requires a parent disposable, but it cannot use the project because plugin code shouldn’t do that
Result
It created a new disposable right before creating the listener.Iteration 2
Not goodPrompt
We shouldn’t create a new disposable to use as a parent disposable right before. That disposable is not handling the lifetime correctly, it is created to just satisfy the function call instead which is not what I want.Result
It created some convoluted mess of duplicate variables and returned to the deprecated method call.I rolled back and tried again with a more focused prompt.