This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-26
Channels
- # announcements (6)
- # babashka (29)
- # babashka-sci-dev (2)
- # beginners (129)
- # calva (9)
- # clara (16)
- # cljdoc (49)
- # clojure (125)
- # clojure-bay-area (3)
- # clojure-europe (55)
- # clojure-france (1)
- # clojuredesign-podcast (8)
- # clojurescript (85)
- # conjure (3)
- # core-logic (2)
- # cursive (1)
- # events (1)
- # honeysql (61)
- # jobs-discuss (23)
- # lsp (69)
- # malli (14)
- # nrepl (3)
- # off-topic (16)
- # portal (11)
- # re-frame (8)
- # releases (1)
- # ring (2)
- # shadow-cljs (12)
- # vim (42)
- # xtdb (18)
Released https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.03.25-12.02.59 with lots of improvements!
• General
◦ Fix cljfmt settings merge during refresh/classpath configs merge to avoid multiple config vectors on same symbol.
◦ Fix install script for aarch64. https://github.com/clojure-lsp/clojure-lsp/issues/794
◦ Fix handling cljfmt config files that end in
.clj
https://github.com/weavejester/cljfmt/issues/190
◦ parser: more efficiently seek to cursor position, improving performance especially in large files. https://github.com/clojure-lsp/clojure-lsp/pull/793 https://github.com/mainej
◦ Fix clean-ns not sorting properly node requires for cljs. https://github.com/clojure-lsp/clojure-lsp/issues/815
◦ Fix move-to-let to ensure locals don't move out of scope. https://github.com/clojure-lsp/clojure-lsp/issues/830
◦ Improve logic around require suggestions. https://github.com/clojure-lsp/clojure-lsp/issues/837
◦ Enhance move-to-let to introduce and expand let if an existing one doesn't exist. https://github.com/clojure-lsp/clojure-lsp/issues/829
◦ Bump org.clojure/clojure
to 1.11.0
.
◦ Fix move-coll-entry to maintain cursor position instead of a range. https://github.com/clojure-lsp/clojure-lsp/issues/862
◦ Clean ns automatically after adding missing require/imports, enabled by default under new :clean :after-ns-refactor
flag. https://github.com/clojure-lsp/clojure-lsp/issues/558
• Editor
◦ extract-function: Fix wrong args when extracting from multi-arity fn. https://github.com/clojure-lsp/clojure-lsp/issues/683
◦ extract-function: Fix wrong args when extracting after a local usage. https://github.com/clojure-lsp/clojure-lsp/issues/812 https://github.com/mainej
◦ move-coll-entry: clauses move intuitively in assoc
, case
, cond
, and similar functions. https://github.com/clojure-lsp/clojure-lsp/pull/780 https://github.com/mainej
◦ move-coll-entry: fix NPE when when invoked from top-level https://github.com/clojure-lsp/clojure-lsp/issues/803 https://github.com/mainej
◦ Generate stubs async after startup, improving startup time. https://github.com/clojure-lsp/clojure-lsp/issues/788
◦ Improve and add lots of new snippets following practicalli config. https://github.com/clojure-lsp/clojure-lsp/issues/797
◦ Improve how watched new files are analyzed avoiding infinite loops and performance issues. https://github.com/clojure-lsp/clojure-lsp/issues/796
◦ Avoid infinite loops when several files are changed simultaneously. https://github.com/clojure-lsp/clojure-lsp/issues/796 https://github.com/mainej
◦ Fix "incoming call hierarchy" not considering usages inside defmethods. https://github.com/clojure-lsp/clojure-lsp/issues/808
◦ range-formatting: more efficiently locate extent of range and reduce number of calls to cljfmt, improving performance especially when formatting large ranges. https://github.com/clojure-lsp/clojure-lsp/pull/795 https://github.com/mainej
◦ cycle-fn-literal: new feature convert between function-literal syntaxes (fn [] ...)
<-> #(...)
. https://github.com/clojure-lsp/clojure-lsp/issues/774
◦ Add find-implementation feature to defmulti
and defmethod
. https://github.com/clojure-lsp/clojure-lsp/issues/751
◦ Make find-implementation of defprotocol
names find its implementations and find-implementation on deftype
/`defrecord` methods find other implementations.
◦ Add new code action Introduce let
for existing command. https://github.com/clojure-lsp/clojure-lsp/issues/825
◦ Make find-implementations consider reify
. https://github.com/clojure-lsp/clojure-lsp/issues/827
◦ Fix namespace on file creation when nested source-paths are available. https://github.com/clojure-lsp/clojure-lsp/issues/832
◦ unused-public-var: fix to show warnings on vars defined with declare. https://github.com/clojure-lsp/clojure-lsp/issues/840
◦ unused-public-var: large performance improvements, especially for large projects. https://github.com/clojure-lsp/clojure-lsp/pull/861 https://github.com/mainej
• API/CLI
◦ Extract lsp4clj as a seperate library. https://github.com/clojure-lsp/clojure-lsp/issues/807 https://github.com/Cyrik Supported by https://www.scarletcomply.com/
◦ Fix inconsistency with clean-ns/format not copying kondo configs.
I'd like to thank @jacob.maine and @domagala.lukas for their contribution making clojure-lsp even better!
This release has a lot of performance improvements, especially related to
unused-public-var
linter that is incredibly faster now thanks to @jacob.maine’s work 👏 This certainly improves startup time and reduce cpu a lot.
We know have a lot of new snippets following @jr0cket’s suggestions, thank you for that!
A new asked feature is available too! Find implementations of defmultis
!
And lots of other improvements/fixes, hope all of you like it! 🚀



Could I go over something, is this no longer valid? #_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
Before I wasn't getting the hint warning. Trying out the new version before pushing to arch and it's now flagging this
@U04V15CAJ @U11EL3P9U reported that
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn foo [a]
1)
doesn't work anymore, after some digging I think it's related with a existing bug that was not present because we lint async the custom-lint and know we rely on kondo reg-finding!
used during custom-lintwill do a quick fix making it async so we can fix it on clj-kondo later carefully
Well, is not that easy to fix that on clojure-lsp, so @U04V15CAJ I know you are busy with the windows issue, so I could try to fix it on clj-kondo, the issue seems to be that reg-finding
https://github.com/clj-kondo/clj-kondo/blob/master/src/clj_kondo/core.clj#L205 doesn't handle-ignore
properly
I think this used to work by luck on clojure-lsp because we async lint that not using reg-finding before
Oh, sorry, the issue seems on clojure-lsp side, clj-kondo there is even a test for that, I think I found the issue, will work on a fix
@U11EL3P9U could you try changing your .lsp/config.edn :linters :clj-kondo :async-custom-lint?
to false
?
or just try latest #clojure-lsp-builds
I think with recent changes and improvements we don't need that flag anymore, but for now will do a quick fix changing that flag default to false
@UKFSJSM38 is this something you’d like help with? Or do you have it handled?
@jacob.maine for now it's fixed, but we should either remove async-custom-lint?
or make it work without those issues, with the improvements we have, we could probably remove it, but I'm afraid huge files with lots of var-definitions could be affected
Yeah, I figured you’d left it in place for really huge files. When you have a chance, will you explain why making it async fixes things? I don’t really understand how reg-finding! works differently in the sync and async versions
Actually, before the huge performance improvements I did that custom linter be async, which doesn't block the rest of lint, that worked and was helpful until we fix performance with this release, now it's not necessary, the code is complex and now causes this bug :), so maybe removing makes sense, we jsut need to make sure the performance is still good for huge files with multiple definitoins and references
Gotcha. If we can remove it that’d be ideal. If not, I’d like to understand how things work. To be honest I’ve never understood how reg-finding! works with an async custom linter. How does clj-kondo know the custom linting is done? My working hypothesis has been that reg-finding! actually doesn’t matter when the linter is async. Instead of waiting for clj-kondo to return us back our own findings, we publish them straight to the client. Is that right?
You can do anything you want in the custom-lint-fn, reg-finding will just take care that whatever you do there will be part of the :findings
returned by clj-kondo itself
but if you're not going to use those, then you don't have to call reg-findings! there of course.
so you could launch an async thread/future/whatever in the custom-lint-fn and just do your own thing with the analysis
@U04V15CAJ I imagine that if you call reg-findings! asynchronously, it’s too late for those findings to be included in clj-kondo’s analysis… clj-kondo will already have returned, right?
That’s what I figured. Just wanted to be sure.
you will just have to keep track which are the most recent / valid findings yourself
> trigger the updating of clojure-lsp’s idea of findings
Yeah, I think that’s what clojure-lsp is doing, or at least what it’s intended to do. This bug suggests maybe that isn’t really working
Right… there are lots of subtle timing bugs we haven’t quite worked out
Definitely, but in the case of your giant Nubank file, which still takes 5 seconds, I can imagine that it’d be nice to start other things like symbol highlighting before the linting is done
Actually, it takes 3s the whole project, I'll test the biggest file to make sure it's still fast
Symbol highlight before lint is dangerous, we may show outdated highlight, we need to wait for kondo analysis to reliable show that
Gotcha. Maybe that’s a bad example
As I’m testing this stuff I keep adding and removing duration logs around custom linting for a single file. Maybe we should add them temporarily until this feature has settled.
Just spotted something else.., I don't think it's pulling in the refer correctly as part of the code action.
Just out of curiosity, what are you using for getting the minibuffer stuff in this position?
My setup is neovim + coc + conjure and coc-clojure. You can find it all here
. Enjoy!
yes, probably related with recent changes c/c @U0BUV7XSA