clojure-lsp / clojure-lsp-intellij

Intellij Plugin for Clojure & ClojureScript development via Language Server (LSP) made in Clojure
https://clojure-lsp.io
MIT License
76 stars 5 forks source link

Cursor position not updated after using `Raise sexpr` #45

Closed eduardolevygp closed 2 months ago

eduardolevygp commented 2 months ago

Describe the bug When using Raise sexpr, the cursor position doesn't change, leaving it in a different place relative to the target expression after the operation executes, making it harder to do consecutive "raises".

To Reproduce Steps to reproduce the behavior:

  1. In a Clojure file, paste the following code: {:a {:b {:c :d}}}
  2. Move cursor to right before the inner-most map ({:a {:b |{:c :d}}} - cursor on the pipe | symbol)
  3. Execute Raise sexpr
  4. Cursor will be positioned inside the map ({:a {:c |:d}})
  5. If Raise sexpr is executed again, it raises only :d instead of the map {:c :d}

Expected behavior Keep the cursor in the same position relative to the expression being "raised". In the previous example, I expected the cursor to be right before the map {:c :d} (|{:c :d}) after the operation, so it can be raised again.

Desktop (please complete the following information):

ericdallo commented 2 months ago

The ideal solution would be to solve this on clojure-lsp side, sending after the edits a window/showDocument request to client to move the cursor to a specified position.

ericdallo commented 2 months ago

Fixed on 2.4.0 + clojure-lsp server update