This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-23
Channels
- # announcements (2)
- # atom-editor (3)
- # babashka (49)
- # beginners (100)
- # biff (9)
- # calva (78)
- # clj-kondo (18)
- # clojure (143)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (58)
- # conjure (1)
- # cursive (4)
- # datascript (11)
- # datomic (63)
- # docker (7)
- # emacs (18)
- # events (1)
- # fulcro (18)
- # graalvm (5)
- # helix (4)
- # improve-getting-started (13)
- # jobs (4)
- # jobs-discuss (3)
- # lsp (15)
- # malli (90)
- # membrane (14)
- # off-topic (12)
- # other-languages (5)
- # pedestal (7)
- # polylith (53)
- # re-frame (15)
- # reitit (23)
- # releases (4)
- # remote-jobs (9)
- # ring (11)
- # shadow-cljs (90)
- # specter (2)
- # testing (3)
- # tools-build (63)
- # vim (2)
- # xtdb (8)
Released clojure-lsp https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.02.23-12.12.12 with a lot of performance improvements and some new features!
• General
◦ Use `:source-aliases` setting during default deps.edn and lein project-spec aliases, avoiding the need to configure a whole project-spec just because of a additional alias.
◦ Exclude from unused-public-var linter vars with metadata `^:export`. https://github.com/clojure-lsp/clojure-lsp/pull/753
◦ Fix clean-ns multiple refers sort when there is a alias before the refers.
◦ Bump clj-kondo from `2022.01.15` to `2022.02.09` adding support for implementation analysis and more improvements.
◦ Medium performance improvement during startup when unused-public-var linter is disabled.
◦ Medium performance improvement during startup on unused-public-var calculation parallelizing calculations.
◦ Small performance improvement on code actions calcullation.
◦ Add `:use-source-paths-from-classpath` setting defaulting to true, which makes clojure-lsp do not manually discovery source-paths but get from classpath excluding jar files and paths outside project-root. https://github.com/clojure-lsp/clojure-lsp/issues/752 https://github.com/clojure-lsp/clojure-lsp/issues/551
◦ Improve completion performance when all clojure.core or cljs.core symbols are valid completions. https://github.com/clojure-lsp/clojure-lsp/pull/764, https://github.com/clojure-lsp/clojure-lsp/pull/771 https://github.com/mainej
◦ Fix scenarios where the lint findings in individual files differed from what you'd expect based on the .clj-kondo/config.edn settings.
◦ Add `:exclude-regex` and `:exclude-when-definted-by-regex` to `:clojure-lsp/unused-public-var` linter.
◦ Bump `org.clojure/clojure` to `1.11.0-rc1`.
• Editor
◦ Fix exception during code actions calculation when in a invalid code of a map with not even key-pairs.
◦ Don't return diagnostics for external files like files on jar dependencies, avoiding noise on lint when opening dependencies.
◦ Support finding implementations of defprotocol and references of defrecord/deftype, implementing LSP method `textDocument/implementation`. https://github.com/clojure-lsp/clojure-lsp/issues/656
◦ Make the actions and commands aware of when they were invoked from comments or whitespace. This will allow individual refactorings to be more deliberate about how they handle comments and whitespace. https://github.com/clojure-lsp/clojure-lsp/pull/716 https://github.com/mainej
◦ Correctly position the cursor after calling move-coll-entry-down on an entry with leading comments. https://github.com/clojure-lsp/clojure-lsp/pull/758 https://github.com/mainej
◦ Don't return completions when invoked from a comment, avoiding performance problems. https://github.com/clojure-lsp/clojure-lsp/pull/756
◦ Fix small anomalies in parameter names of extracted private functions. https://github.com/clojure-lsp/clojure-lsp/pull/759 https://github.com/mainej
◦ Add semantic tokens for protocol implementations methods like defrecord and deftype.
◦ Small performance improvevement on code lens calculation using transducers.
• API/CLI
◦ Small performance improvement to `format`, `clean-ns`, `diagnostics`, and `rename` via parallelizing parts of the logic.
◦ Fix edn->json parser of `serverInfo/raw` for Calva use cljfmt configuration. https://github.com/clojure-lsp/clojure-lsp/issues/763
◦ Add `:cljfmt-raw` config to `serverInfo/raw` for Calva. https://github.com/clojure-lsp/clojure-lsp/issues/768
◦ Add support for passing specific `--filenames` for most actions. https://github.com/clojure-lsp/clojure-lsp/issues/775
Main highlights:
The focus of this release was to make clojure-lsp faster on a lot of places, especially on the post-startup time, which stands for the time clojure-lsp analyzed whole project with clj-kondo default linters but is yet linting whole project for unused-public-vars and looking for test trees. 🚀
We did lots of completion and code actions performance improvements thanks to @jacob.maine which did a great help on that! 👏
Following @borkdude suggestion, clojure-lsp by default now check source-paths from the classpath string and not manually checking your project deps file, this should decrease a lot the false-positives of wrong source-paths, especially for lein/deps mono-repo projects! Check https://clojure-lsp.io/settings/#source-paths-discoveryfor more details 🏁
And at least but not last, we now have support for finding implementations of defprotocols following LSP spec and with the help of clj-kondo 🎉 check the gif for a example
This release was supported by https://www.clojuriststogether.org/
Thank you for the new gold sponsor https://github.com/180seg 🧡

Regarding the source path change, looks like :use-source-paths-from-classpath
breaks :ignore-classpath-directories
?
I’d set :ignore-classpath-directories
to false
in one of my projects, and the latest release shows references from my resources/
directory as :use-source-paths-from-classpath
is set to true
by default.
No biggie as I can just set :use-source-paths-from-classpath
to false
, but I thought I’d ask if this was intended.
As in, would :ignore-classpath-directories
be replaced by :use-source-paths-from-classpath
at some point?
Yes, unfortunately there is no way to differ the "target" dirs from a dir on the classpath AFAIK, so for those cases disabling this new flag is probably needed
@U0WKCCE3S actually we could check for :ignore-classpath-directories
when checking the source-paths, I think that could work, do you have a sample project where I could test it these changes?
The ignore-classpath-directories
is a obscure flag I'd like to improve/make it smarter somehow, so I feel we have room to improve here
I used a boilerplate CLJS project and lein with :source-paths
. No :source-aliases
in project.clj
though.
The exact issue I was having was that files in resources/public/js
were getting picked up as duplicate references.
Hmmm can :ignore-classpath-directories
be used to drive :use-source-paths-from-classpath
? It looks like :use-source-paths-from-classpath
overrides :ignore-classpath-directories
right now.
yes, ATM :use-source-paths-from-classpath
is not overriding but causing clojure-lsp to consider the paths which were ignored by :ignore-classpath-directories
at some other point of the code, Threrefore "ignoring" the flag.
I think we can check for :ignore-classpath-directories
after checking :use-source-paths-from-classpath` to keep the old behavior, but as I'm not a heavy cljs user I always have issues trying to repro
ignore-classpath-directories
cases, that's why I asked for a sample repro 😅
Ah right! I’ll create a public repo then, as I was using a private repo with limited sharing.
@UKFSJSM38 I’m having this problem in the clojure-lsp repo 😅 cli/target/classes/clojure_lsp is showing up as references. I’m a little confused as to which flag I’d need to stop this from happening
I can create an issue if you want. To repro I just open the repo calva after running make