This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-03
Channels
- # announcements (17)
- # asami (17)
- # babashka (20)
- # beginners (110)
- # calva (1)
- # cherry (3)
- # cider (1)
- # clj-kondo (21)
- # clj-on-windows (1)
- # cljsrn (5)
- # clojure (142)
- # clojure-austin (1)
- # clojure-europe (72)
- # clojure-france (28)
- # clojure-hungary (2)
- # clojure-nl (2)
- # clojure-norway (38)
- # clojure-poland (2)
- # clojure-uk (3)
- # clojurescript (4)
- # cursive (33)
- # data-science (3)
- # datahike (5)
- # datomic (1)
- # emacs (27)
- # events (3)
- # fulcro (15)
- # graalvm (4)
- # gratitude (2)
- # honeysql (7)
- # humbleui (8)
- # introduce-yourself (11)
- # jobs-discuss (9)
- # lambdaisland (3)
- # lsp (18)
- # malli (62)
- # music (1)
- # nbb (3)
- # off-topic (10)
- # pathom (3)
- # pedestal (6)
- # polylith (5)
- # re-frame (7)
- # releases (2)
- # shadow-cljs (33)
- # sql (1)
- # test-check (23)
- # vim (20)
- # xtdb (9)
Released clojure-lsp https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.11.03-00.14.57 with performance improvements and more! 🚀
• General
◦ Bump clj-kondo to 2022.11.02
avoiding breaking changes on custom hooks.
◦ Bump graalvm to 22.3.0. https://github.com/clojure-lsp/clojure-lsp/issues/1345
• Editor
◦ Add refactorings to change param order of defn
/`defmacro`, also changing call sites. https://github.com/clojure-lsp/clojure-lsp/issues/1131
◦ Avoid shadowing existing locals when restructuring keys. https://github.com/clojure-lsp/clojure-lsp/issues/1229
◦ Let editors control whether the server's log includes traces of the messages they are exchanging. https://github.com/clojure-lsp/lsp4clj/issues/27
◦ Bump promesa to 9.0.470
◦ Bump lsp4clj to 1.5.0
◦ For users with fewer cores, avoid unnecessary waits for file analysis.
◦ Reduce CPU usage by aborting requests that the client won't use.
◦ Fix to mark some code actions as preferred, so editors can emphasize them. https://github.com/clojure-lsp/lsp4clj/issues/32
◦ Adds java classes completions, since clj-kondo now knows all java classes defined on external dependencies. https://github.com/clojure-lsp/clojure-lsp/issues/1329
◦ Fix completion to consider required namespaces without alias or refers. https://github.com/clojure-lsp/clojure-lsp/issues/1352
Most important changes were related to improvements on lsp4clj side regarding cancelling requests that client doesn't care anymore.
We also have a new refactoring to swap param order of functions! 🎉
Happy coding! 👋
I wrote a custom clj-kondo.hook for a macro, and now I can't use go-to-definition on it (it just move cursor at the beginning of the line).
Just to give a few details:
Imagine macro is called macro-name
.
My hook:
(defn my-hook-fn [{:keys [node]}]
...
{:node (with-meta
(list-node (list (-> node :children first) (do ...)))
(meta node))
sexpr
of this node that is returning from my-hook-fn is:
(macro-name (do ...))
How do I debug it? Maybe someone had this problem already? 🙏:skin-tone-2:
P.S.
defn
block inside this do
was the problem. I had to wrap it with meta
So your macro defines a var-definition right? that's why you want to go to the definition
I think you need to add a (def
aanywhere in your code, @U04V15CAJ may know more about it
No, I am not defining this macro-name
. I am rewriting node only to have this do
block inside.
The macro-name
is used like (macro-name {...})
And I am rewriting it to be like (macro-name (do ...))
This macro is defined in a ns called macros
. And I want to go here with gd
.
I see, I think your (meta node)
is wrong, you should use the meta of the first children I guess
not sure though, @U04V15CAJ may know better
Hmm, I think your first idea was right... I should rewrite this node to be a definition.
P.S. No, I don't want it to be a new defn
thing, I just want go-to-definition work on this.
I found the cause of this problem. I was adding a "defn" node inside this "do" block. To fix the problem, I wrapped defn-node in its own meta, and that fixed the problem.
@UL05W6AEM You can debug using println
and then call the linter from the command line
or you can develop hooks in the REPL: https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#tips-and-tricks