@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)
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)
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))))Just noticed I replied in the channel hehe
Looks good!
OK, great!
Oh I actually missed that PR from my review this week, will take a look today
I think it's ok about the comments