This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-19
Channels
- # announcements (1)
- # babashka (26)
- # beginners (42)
- # calva (3)
- # cider (5)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (13)
- # clojure (95)
- # clojure-europe (12)
- # clojure-germany (3)
- # clojure-italy (12)
- # clojure-nl (1)
- # clojure-spec (16)
- # clojure-uk (25)
- # clojurescript (13)
- # clojureverse-ops (5)
- # community-development (1)
- # conjure (8)
- # cryogen (3)
- # datomic (5)
- # deps-new (7)
- # exercism (1)
- # fulcro (34)
- # honeysql (9)
- # hyperfiddle (3)
- # instaparse (2)
- # introduce-yourself (2)
- # jobs (6)
- # kaocha (1)
- # lambdaisland (1)
- # lsp (47)
- # malli (3)
- # membrane (38)
- # off-topic (9)
- # polylith (36)
- # reitit (7)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (11)
- # spacemacs (7)
- # sql (7)
- # tools-deps (19)
hey @ericdallo how are you? I have a lein project where :source-paths
is handled by dynamic evaluation and seems like clojure-lsp
is not handling this correctly at initialization phase. I made a reproducible repo for this error, https://github.com/wandersoncferreira/source-path-repro is this a known issue?

seems like https://github.com/wandersoncferreira/clojure-lsp/blob/39c852ed79e89056a400e1137187a10e50688aa5/src/clojure_lsp/config.clj#L97 receives a list of strings ('~' 'get-path' 'feature' 'lib')
Clojure-lsp reads the project.clj :source-paths from root level and some default aliases and fallback to a default if not found
This is related with dyncamic source-paths indeed, clojure-lsp can't resolve them as it uses static analysis so I'll fix it to use fallback to the default source-paths or use the provided from user
@UBSREKQ5Q I made a https://github.com/clojure-lsp/clojure-lsp/commit/b3eeed1043b620833b2709f3742efd8bec9b6ef2, could you validate if that avoid at least the wrong source-paths for your project?
works! 🙂 however, I think would be nice to emit a warning into clojure-lsp::std-error
buffer informing that config was invalid and clojure-lsp fallback to defaults
Released https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.07.19-14.46.52 🚀
• General
◦
clean-ns
now sorts ns children forms according to the https://github.com/bbatsov/clojure-style-guide#comprehensive-ns-declaration, at the moment moving require form before import form, enabled by default under flag `:clean :sort :ns` setting.
◦ Improve startup error handler and logging during project analysis. Related to https://github.com/clojure-lsp/clojure-lsp/issues/484
◦ Performance improvements using transducers on analysis queries.
◦ Fixed auto-resolve source-paths for lein projects that get source-paths dynamically, clojure-lsp will use the default source-paths for these cases
• Editor
◦ Improve hover output, both markdown and plain text forms. (kudos @nbtheduke)
◦ Allow calling thread-first/last and thread-first-all/last-all from within the list. (kudos @nbtheduke)
◦ Improve `resolve-macro-as` messages and default excluded symbols. c/c @brandon.ringe
• API/CLI
◦ Fix empty `XDG_CONFIG_HOME` not defaulting to `$HOME/.config` https://github.com/clojure-lsp/clojure-lsp/issues/474 (kudos @andreyorst)
◦ Improve verbose logging setting to now show logs along with `Analysis project` message.
Probably the most important improvement is the performance one, using transducers and improving the analysis comparassion using `identical?` for keywords and `.equals` with type hint for symbols and strings reduced some analysis time by half using https://github.com/hugoduncan/criterium as the benchmark tool, this should affect most features that use clj-kondo analysis under the hood.

Thanks for the resolve-macro-as
improvements. It's great to hear performance improvements have been made!
Thanks for the updates! I notice occasional freezes when saving a file. I'll see if I can repro later
i just updated lsp-mode for emacs. I'm hitting C-M-x
which C-h c
verifies is bound to inf-clojure-eval-defun
and i'm instead getting an error Symbol's value as variable is void: lsp-actionscript
. Does this ring a bell for anyone?
clojure-lsp is one of the most impressive projects out there! Improving at an almost incredible pace. Stellar support on top of that.
Quick observation from a first timer. From the release notes I was curious to try clean-ns! from a deps.edn alias. It's not a use case covered neatly in documentation (or I couldn't find it). Not sure it's a primary use case so that might be fine. Anyway, here's how I did it...
{:deps {...}
:paths ["src"]
:aliases
{:lint-ns {:extra-deps {com.github.clojure-lsp/clojure-lsp {:mvn/version "2021.07.19-14.46.52"}}
:exec-fn clojure-lsp.api/clean-ns!
:exec-args {:dry? true}}}}
then invoked by
clojure -X:lint-ns

As an aside, it failed with a timbre related error. Syntax error compiling at (taoensso/timbre/appenders/core.cljc:30:4). No such var: enc/system-newline Full report at: /var/folders/p1/mtpt77lx3gv5q88s9_l0b2w00000gp/T/clojure-4034124860266134319.edn
Hey @U055DUUFS there is an example here of using it as a lib on a deps.edn: https://clojure-lsp.github.io/clojure-lsp/api/#library
Ah, good stuff. Showing the cli command might help those unfamiliar with :exec-fn
Will do
While I have you. This page has a small typo: https://clojure-lsp.github.io/clojure-lsp/settings/.
s/ns-inner-blocks-indenation/ns-inner-blocks-indentation/
Same error with verbose flag. I'm trying out the brew installed binary now... exciting stuff.
That includes the full deps.edn, shell session and log file generated.
humm, I think the issue is a conflict with your lib: com.taoensso/encore {:mvn/version "2.75.0"}
and the version you use probably is different from the version clojure-lsp timbre uses
you actually have an outdated encore lib. timbre is using a more updated https://github.com/ptaoussanis/timbre/blob/master/project.clj#L14
Thanks, I'll give that a try. (it's a super old project)
Much happier now (still running)