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.
Iteration 3 (new task)
OkayPrompt
Implement disposable to TestBenchComponent and register it correctlyResult
It did implement the disposable, but didn’t register it.Conclusion
I implemented disposable for the settings configurable myself and passed that reference to use as the parent disposable.
Junie didn’t solve my issue, but I also didn’t know what I was specifically asking for. I did however find the AI assistant very useful on finding out how to correctly solve the issue.