Fork me on GitHub
#lsp
<
2024-01-31
>
Max17:01:00

Is there an existing refactor action for inlining bindings? Sort of the opposite to “move to let”, but where it would also remove the let if you remove the last binding

ericdallo17:01:25

you mean inline-symbol code action?

Max18:01:17

That’s it! Though I noticed it errors out if the binding comes from destructuring

Max15:02:21

Should I file a bug for that?

ericdallo16:02:48

Do you have a code snippet or repro so I can confirm it's a bug?

Max16:02:27

(let [[x xs] (range 5)]
  (inc x))
Put your cursor on the x in inc x and use the inline-symbol action. You can see the following error in the Clojure Language Client feed:
[Error - 11:54:04 AM] Request workspace/executeCommand failed.
  Message: Internal error
  Code: -32603 
[object Object]

ericdallo17:02:04

yep, I can repro, it's a bug, please open a clojure-lsp issue