This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-28
Channels
- # announcements (12)
- # babashka (87)
- # beginners (84)
- # calva (22)
- # circleci (4)
- # clj-kondo (46)
- # cljdoc (6)
- # cljsrn (15)
- # clojure (87)
- # clojure-europe (18)
- # clojure-uk (7)
- # clojurescript (20)
- # community-development (3)
- # conjure (1)
- # cursive (13)
- # datomic (14)
- # events (7)
- # fulcro (27)
- # graphql (31)
- # helix (8)
- # jobs-discuss (1)
- # lsp (43)
- # malli (11)
- # meander (64)
- # off-topic (7)
- # pathom (26)
- # polylith (9)
- # practicalli (2)
- # re-frame (33)
- # reagent (2)
- # reitit (5)
- # releases (2)
- # rewrite-clj (2)
- # shadow-cljs (69)
- # specter (5)
- # sql (1)
- # tools-deps (85)
- # tree-sitter (1)
- # vim (3)
When invoking the clojure-lsp API through a deps.edn alias, is it normal that no output is printed (when verbose
is false)?
[lassemaatta@desktop vk]$ clojure -X:clean-ns
[lassemaatta@desktop vk]$
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?
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! {})))}"]}
@clojurians-slack100 semantic highlighting is go go go again! https://github.com/clojure-lsp/clojure-lsp/issues/495 See last comment.
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!)?
Released https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.07.28-14.24.06 : • 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.
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
:
(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
maybe @U04V15CAJ knows
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
it’s very possible this is something i’ve messed up in my config, i’ll poke around and see what’s up