Fork me on GitHub

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, is this a known issue?

all-clear 4

as a workaround I am defining :source-paths in .lsp/config.edn file.


Could you share your project.clj?


Clojure-lsp reads the project.clj :source-paths from root level and some default aliases and fallback to a default if not found


Oh I didn't notice your repro link, let me check


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, could you validate if that avoid at least the wrong source-paths for your project?


Thank you for the report though!


I will check now, thanks


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


yeah, that could be done as a improvement indeed

👍 4

clojure-lsp Released 🚀 • General ◦ clean-ns now sorts ns children forms according to the, 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 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` (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 as the benchmark tool, this should affect most features that use clj-kondo analysis under the hood.

🎉 8
catjam 2
🚀 2

Thanks for the resolve-macro-as improvements. It's great to hear performance improvements have been made!

😄 2

Thanks for the updates! I notice occasional freezes when saving a file. I'll see if I can repro later


thanks! I'd guess is a issue with lsp client, LMK when have the repro

👍 2

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?


I think I saw this issue somewhere on lsp-mode


I'd suggest asking on lsp-mode discord channel

👍 2

clojure-lsp is one of the most impressive projects out there! Improving at an almost incredible pace. Stellar support on top of that.

❤️ 10
Oliver George23:07:27

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"]
  {: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

all-clear 4
Oliver George23:07:59

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:


But your code looks good


Could you try adding the :verbose true flag?


Not sure this could help, but can you try use replace-deps instead of extra-deps

Oliver George23:07:31

Ah, good stuff. Showing the cli command might help those unfamiliar with :exec-fn

Oliver George23:07:11


Oliver George23:07:04

Same error with verbose flag. I'm trying out the brew installed binary now... exciting stuff.


Thanks, I'll update the typo


Could you paste the stacktrace with the verbose flag?

Oliver George23:07:23

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"}


because clojure-lsp logging lib, timbre , uses encore under the hood


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


that's why I suspect replacing :extra-deps with :replace-deps could work for you

Oliver George23:07:14

Thanks, I'll give that a try. (it's a super old project)

Oliver George23:07:03

Much happier now (still running)


I confirmed bumping com.taoensso/encore to latest fix the issue

Oliver George00:07:01

Thanks for your time.

👍 4
Oliver George00:07:11

(finished successfully here too)

🚀 4
Oliver George23:07:04

Can't tell you how nice it is to have clean-ns in my life. Thank you.

❤️ 6
🚀 4