lsp

JR 2025-12-30T18:38:49.155089Z

@ericdallo I'm nearing done with changes to extract to a new function from within threading (#2175). This includes the selection in extract-function, so it builds on the already submitted, but not merged, #2170 (https://github.com/clojure-lsp/clojure-lsp/pull/2170). Would it be better for me to submit a new PR with the code from #2170 in it, or wait until #2170 is merged? (No rush either way, I can put it on the shelf for a bit)

JR 2025-12-30T18:40:46.002759Z

Speaking of #2175 (extract-function from threading) I included some changes to extract comments along with the sexprs because it's nice for the threading macros. This doesn't seem controversial when using selection, since the comments are contained in the selection. But along with this, I'm including comments when extracting a single sexpr if the cursor is in the comment preceding the expression. This does change the unit tests. Is this OK? (more in thread below)

JR 2025-12-30T18:42:05.817589Z

Here's an example of a unit test that was changed. Note that the comment is now included

(testing "from comment"
    (h/reset-components!)
    (is (= [(h/code ""
                    "(defn- foo [a]"
                    "  ;; comment"
                    "  (+ 1 a))"
                    "")
            (h/code "(foo a)")]
           (-> (h/code "(let [a 1 b 2 c 3]"
                       "  ;; |comment"
                       ""
                       "  (+ 1 a))")
               (do-extract-function "foo")
               as-strings))))

ericdallo 2025-12-30T18:42:49.015939Z

Just noticed I replied in the channel hehe

ericdallo 2025-12-30T18:42:59.223969Z

Looks good!

JR 2025-12-30T18:43:07.528679Z

OK, great!

ericdallo 2025-12-30T18:41:20.094259Z

Oh I actually missed that PR from my review this week, will take a look today

ericdallo 2025-12-30T18:42:04.061239Z

I think it's ok about the comments

👍 1