sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.59k stars 275 forks source link

Agent: add automatically generated bindings for Java #4617

Closed olafurpg closed 3 months ago

olafurpg commented 3 months ago

Previously, we only generated bindings for Kotlin. The Eclipse plugin is written in Java so this PR adds support to generate Java bindings as well. Java and Kotlin are very similar so required diff is minimal. The Java code is not added to this repo because we already have the Kotlin bindings here and I don't want every agent-protocol.ts PR to have a huge diff. Instead, we can just commit the Java bindings directly to the Eclipse repo.

Note: the code generator implementation is already quite messy and it's getting more messy with this PR. I am willing to take on this tech debt for now because it's easy to catch regressions from diffs in the generated code.

Test plan

Minimal and low-risk diffs in Kotlin bindings (adding semi-colons and using Java getter method names instead of Kotlin sugar)

olafurpg commented 3 months ago

The codegen tool is only used by Eclipse at the moment (JB hasn't even adopted it yet) so this is a low-risk PR to merge