calva icon indicating copy to clipboard operation
calva copied to clipboard

error when slurping forward before commented s-expressions

Open blnote opened this issue 1 year ago • 3 comments

Using the slurp sexp forward command at (|) #_(dosomething)

results in

( #_)(dosomething)

and the error:

:uneval node expects 1 value. [at line 1, column 6]

also: drag expression forward in the above scenario produces #_ ()(dosometing) destroying the commented expression. no error is printed in this case.

Calva version used: v2.0.409 clojure-lsp version used: 2023.12.29-12.09.27 clj-kondo version used: 2023.12.15

blnote avatar Jan 23 '24 09:01 blnote

Hi! Thanks for reporting!

The issue with how to treat the ignore marker is a bit unsolved in Calva. I agree the behaviour is incorrect, but will have to investigate if it can be easily solved without causing funny behaviour elsewhere.

PEZ avatar Feb 08 '24 20:02 PEZ

Hey, thanks for your response! Just wanted to note that slurping ignored forms works with clojure-lsp (using paredit functionality from rewrite-clj i think). however dragging using lsp also has a problem with ignored forms. anyways, certainly not high priority, thanks a lot for your work.

blnote avatar Feb 09 '24 14:02 blnote

I see that there is a rather old PR concerning ignore markers and dragging:

  • https://github.com/BetterThanTomorrow/calva/pull/2170

I don't recall why we never merged it. Maybe we just forgot? Anyway, I'll have a look and see if it enlightens/reminds me a bit about the nature of the problem.

PEZ avatar Feb 11 '24 11:02 PEZ