Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Codegen: Improve Formatter for better field name handling (#5534)
CLOSE https://linear.app/sourcegraph/issue/CODY-3696/codegen-generated-invalid-field-name-causing-jetbrains-build-to-fail This PR fixes the issue where codegen does not escape all the invalid characters for field names. - Replace non-alphanumeric characters with underscores for Kotlin field names - Add helper function `getEscapedValue` to handle various field name formatting rules Also removed the bindings from the agent/bindings/kotlin/lib/bin/main/com/sourcegraph/cody/agent/protocol_generated directory ## Test plan <!-- Required. See https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles. --> Run the generate agent bindings command to confirm everything works as expected. Some before and after comparison: before: const val `recently used` = "recently used" const val `https__/example.com` = "https://example.com" after: const val `recently-used` = "recently used" const val `https-example-com` = "https://example.com" ## Changelog <!-- OPTIONAL; info at https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c -->
- Loading branch information