Fork me on GitHub

When invoking the clojure-lsp API through a deps.edn alias, is it normal that no output is printed (when verbose is false)?


I would expect the value of {:result-code 1 :message (edits->diff-string edits) :edits edits} to show up somewhere, but do I need to do something extra to get it printed?


Hum, this is probably following the same behavior of calling as API


Would you expect print in the console?


for example. I think typically a "dry run" option implies a) don't actually perform any side-effects, but b) indicate somehow what would occur if the dry run parameter is false


I haven't been using the clojure cli tools for long, perhaps there's an easy way to get the return value out to stdout? Assuming of course that the map returned by the API contains what I think it contains


yeah, that happens exactly as you described running manually via cli clojure-lsp clean-ns --dry , but not running via API/deps, we need to improve that so


I have a fix in mind, we can just print to stdout, ATM we only do that if we called via the clojure-lsp.main which is called when clojure-lsp is called via CLI


ah, silly me. I had not realized I could just invoke the clojure-lsp binary directly, instead of calling it through deps.edn


the --dry option for the binary does exactly what I expected


but as you said, it might be a good idea to add printing to stdout or something when calling it through deps, unless the clojure cli has some way to see what the :exec-fn returns


there is a way, not that pretty, but it's possible, @UMMMKKADU did some hacking to be able to do that I think


hahaha, "some hacking" you are being kind Here one alias I did testing this:

:lint-fix {:extra-paths ["test"]
                      :extra-deps {com.github.clojure-lsp/clojure-lsp {:mvn/version "2021.07.12-12.30.59"}}
                      :main-opts ["-e" "(require 'clojure-lsp.api) {:file-formats (count (:edits (clojure-lsp.api/format! {}))) :ns-cleaned (count (:edits (clojure-lsp.api/clean-ns! {})))}"]}


haha , yeah, in this case you want the return map of the call, which makes sense


printing to stdout could be another flag maybe...


@clojurians-slack100 semantic highlighting is go go go again! See last comment.


Wow, thanks a lot for the investigation!


Looks like it's working 🎉


Apparently it has been disabled due to some issues with treesitter and colourising and is being reworked atm. I don't use treesitter, so I've re-enabled it 🙂


Is there anything to look out for other than ns highlighting (which is already awesome!)?


Also, thanks for leading me to palenight 😄


clojure-lsp Released : • General ◦ Minor fix on the analysis queries comparison. ◦ Improve GraalVM configuration to use direct/less configurations. ◦ Bump clj-kondo 2021.06.18 -> 2021.07.28 which adds support for macroexpanding. • Editor ◦ Fix outgoing/incoming call hierarchy when vars are outside project/external jars. ◦ Fix completion of aliases without var names typed yet, for example: `string/` • API/CLI ◦ Fix filename in diffs with dry option. ◦ Add coloring to diffs following git diff. ◦ Add `ns-exclude-regex` for commands that check whole project, allowing to exclude certain namespaces via regex.

🎉 15

is it possible to look at a clojure.core function that’s defined with def to see if it’s in fact a function?


for example, showing the documentation of conj doesn’t display the parameter lists cuz it’s technically a def :

 ^{:arglists '([coll x] [coll x & xs])
   :doc "conj[oin]. Returns a new collection with the xs
    'added'. (conj nil item) returns (item).  The 'addition' may
    happen at different 'places' depending on the concrete type."
   :added "1.0"
   :static true}
 conj (fn ^:static conj


ATM no, this is a feature suggestion on clj-kondo side I think


I think there is already a issue open about this somewhere :thinking_face:


i should have checked the issues first! thanks so much


I want to extract-function while hovering over the right side of a let assignment: (when (some-func) (let [x (do-something-here)] ...)) . I call the extract-function action, and it extracts the when block above and everything inside of the let block as well. Is there some way to make it apply to only the innermost sexp?


it does work as expected to me if hovering on the ( of the do-something-here or hover on do-something-here


ah, you know what, i was running :CocAction which seems to have different semantics than calling the <Plug>coc-codeaction-cursor that i have bound to a key combo


i wonder why that is


i get the correct result you have in that gif if i do the -cursor version


so it's one more weird vim thing 😛


haha just keep piling them on!

😂 3

it’s very possible this is something i’ve messed up in my config, i’ll poke around and see what’s up