Closed Cyrik closed 2 years ago
@mainej I think we should try to fix that before next release to avoid breaking Calva
@Cyrik sorry about that. Good catch. @ericdallo, I agree, this should be fixed. I ran into this problem before—I can't remember where, but somewhere else we needed to preserve kebab-case. The solution I came up with is that in lsp4clj, keywords are camelCased, but anything else is just stringified. So, if we convert the keys of server-info to kebab-case strings, they'll pass through to the editors unchanged. We could do this manually, but it's probably safer to do automatically, with camel-snake-kebab.core/->kebab-case-string
. @ericdallo, camel-snake-kebab is already a dependency of lsp4clj. Would you prefer to add it to clojure-lsp's dependencies and do the conversion in clojure-lsp? Or would you prefer a helper in lsp4clj that does that? (Another case where lsp4clj.utils would be useful.)
@mainej thanks for taking a look, I'm fine having it on clojure-lsp or lsp4clj until we have some utils on lsp4clj side, maybe on clojure-lsp side since it's the only place used ATM
Describe the bug When the client calls 'clojure/serverInfo/raw' the map keys are now in camelCase instead of kebab-case.
To Reproduce Steps to reproduce the behavior: send 'clojure/serverInfo/raw' to clojure-lsp or start Calva
Expected behavior Until now it seems to have been sent in kebab-case.
Screenshots If applicable, add screenshots to help explain your problem.
Log - client <-> server
Additional context Add any other context about the problem here.
I'm guessing the coercer did the case switching before lsp4clj v1. We now have to decide if clojure-lsp should go back to the old behavior or if Calva and Co need to understand the new syntax. I'm fine with either.