-
Notifications
You must be signed in to change notification settings - Fork 455
Agent: automate generation of Kotlin bindings #3142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Didn't open a draft PR, but I'm going to review this myself tomorrow before tagging for reviews. |
abc5ff8
to
c8ad6a5
Compare
Companion PRs: * sourcegraph/scip#231 * sourcegraph/cody#3142 Previously, scip-typescript didn't emit any structured information about signatures. This PR solves that problem, which unblocks new exciting use-cases for SCIP. Keeping this PR open for a while since we are not planning to merge signature support to SCIP just yet. For now, the Cody repo can use this branch instead.
Companion PRs: * sourcegraph/scip#231 * sourcegraph/cody#3142 Previously, scip-typescript didn't emit any structured information about signatures. This PR solves that problem, which unblocks new exciting use-cases for SCIP. Keeping this PR open for a while since we are not planning to merge signature support to SCIP just yet. For now, the Cody repo can use this branch instead.
Companion PRs: * sourcegraph/scip#231 * sourcegraph/cody#3142 Previously, scip-typescript didn't emit any structured information about signatures. This PR solves that problem, which unblocks new exciting use-cases for SCIP. Keeping this PR open for a while since we are not planning to merge signature support to SCIP just yet. For now, the Cody repo can use this branch instead.
Until now, we have been manually writing Kotlin bindings for the agent protocol. This worked fine when only a small number of people worked on the protocol and the protocol was small, but has become increasingly problematic as more people are actively working on the JetBrains plugin and the size of the Agent protocol has grown. For example, if you make a mistake in the bindings, you may end up spending a long time debugging why something is not working because the error messages can be cryptic. This PR adds a new script to automatically generate Kotlin bindings so that we no longer need to rely on manually written bindings. Simplified, the script works like this: - Index the codebase with a fork of scip-typescript. This fork uses an extension of SCIP that adds `SymbolInformation.signature` (more details here sourcegraph/scip#231). - Use the structured type signatures from the SCIP index, translate it into Kotlin code, and report errors if something in the protocol has no clean translation to Kotlin. - Add the generated code to the Cody repo so that we can closely track what Cody PRs are influencing the protocol, and how they're influencing it.
671063b
to
6392911
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! The changes on the vscode
side are minuscule and it's very easy to turn this off if it causes problems but even in its current state this is a huge improvement for the work on the JetBrains extension (even if we don't keep the types updated) so let's go
The recent changes to the agent (sourcegraph/cody#3142) broke the API - this is a fix. ## Test plan 1. write @ in the chat 2. the files appear
Companion PRs: * sourcegraph/scip#231 * sourcegraph/cody#3142 Previously, scip-typescript didn't emit any structured information about signatures. This PR solves that problem, which unblocks new exciting use-cases for SCIP. Keeping this PR open for a while since we are not planning to merge signature support to SCIP just yet. For now, the Cody repo can use this branch instead.
Companion PRs: * sourcegraph/scip#231 * sourcegraph/cody#3142 Previously, scip-typescript didn't emit any structured information about signatures. This PR solves that problem, which unblocks new exciting use-cases for SCIP. Keeping this PR open for a while since we are not planning to merge signature support to SCIP just yet. For now, the Cody repo can use this branch instead.
Until now, we have been manually writing Kotlin bindings for the agent protocol. This worked fine when only a small number of people worked on the protocol and the protocol was small, but has become increasingly problematic as more people are actively working on the JetBrains plugin and the size of the Agent protocol has grown. For example, if you make a mistake in the bindings, you may end up spending a long time debugging why something is not working because the error messages can be cryptic.
This PR adds a new script to automatically generate Kotlin bindings so that we no longer need to rely on manually written bindings. Simplified, the script works like this:
SymbolInformation.signature
(more details here Add support forSymbolInformation.signature
scip#231).Test plan
Green CI