This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-19
Channels
- # announcements (9)
- # babashka (5)
- # babashka-sci-dev (23)
- # beginners (160)
- # calva (78)
- # cider (23)
- # clj-commons (2)
- # clj-kondo (5)
- # cljdoc (19)
- # cljs-dev (8)
- # clojure (54)
- # clojure-australia (1)
- # clojure-czech (2)
- # clojure-dev (17)
- # clojure-europe (8)
- # clojure-italy (8)
- # clojure-nl (2)
- # clojure-sg (3)
- # clojure-uk (4)
- # clojurescript (70)
- # community-development (8)
- # core-async (8)
- # cursive (7)
- # datahike (12)
- # datalog (22)
- # datomic (20)
- # events (1)
- # fulcro (43)
- # graalvm (92)
- # gratitude (5)
- # holy-lambda (77)
- # honeysql (1)
- # jobs (1)
- # lsp (111)
- # membrane (70)
- # nextjournal (13)
- # off-topic (73)
- # pathom (1)
- # polylith (8)
- # portal (32)
- # re-frame (3)
- # reagent (4)
- # reitit (5)
- # releases (2)
- # reveal (4)
- # xtdb (22)
clojure-lsp format
takes quite a long time to run a medium-big project, and the weird thing is that it stays for most of the time at 95% Analyzying project files
I guess it's just not estimating correctly how long it would take in total
about the format, unfortunately, it's cljfmt performance issue, I don't think we have anything to improve on clojure-lsp side
the percentage report is quite new @andrea.crotti I'm still tweaking one thing or other :)
yeah ok sure np
could the formatting run more concurrently?
it seems like it's doing one file at a time
wait a sec, when it's 95% Analyzing project files
, clojure-lsp is still analyzing with kondo, we didn't call cljfmt yet
yeah ok, both thinigs are pretty slow tbf
takes a few minutes just analyzing, and then a long time formatting
Alright, about the formatting, we could ask cljfmt for performance improvements, @U016JRE24NL already helped a lot in the past with performance improvements on cljfmt side.
About the 95%
, this is when clojure-lsp is analyzing the project files with kondo, we already pass the :paralel
flag to kondo run in paralel, not sure there is anything we could improve there besides a better report progress bar :/
just a few hundred lines
just a few above 1k maybe
around 40k lines of clojure in total
well maybe I have a slow disk as well, since the dev environment is inside docker
I actually get a syntax error
just pulled master
trying just with time clojure-lsp format
instead
1 minute and 31 seconds
running clojure-lsp format
on the clojure-lsp codebase
so well I guess just a slow disk
well a lot longer for that too
maybe 30 seconds
whe you run clojure-lsp for the first time in a project, it analyze the whole classpath (external analysis)
yeah took 34 seconds the second time
in total
ok well anyway no worries was just curious
yeah, this is something I'm always trying to improve since it's the heaviest thing on clojure-lsp, next release should use Datalevin instead of sqlite which increase the cache finding (`10%`) and cache save after external analysis
another thing which I'm confused about is that for example clojure-lsp clean-ns
would show also things like
Cleaned re-graph.core
, but that's not a ns in my project at all
Cleaned zprint.zprint
is another example
where is it getting these from?
is it not just supposed to go through all the namespaces in the current project directory simply?
mm of what though? only thing would be clj-kondo config.edn but that doesn't mention zprint or re-frame either
alright I can try to see what clj-kondo is returniing
I'll check clj-kondo output first
if I can reproduce it I'll report
it is weird because most of them are correct, just namespaces inside my project
but maybe a 10% is stuff like re-frame.subs
cljs.tools.reader
or other things
totally unrelated
This is how clojure-lsp find the namespaces: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/internal_api.clj#L115-L119
mm not really no
right I just tried on one of my open source projects
and I see the same behaviour
with this one https://github.com/andreacrotti/elo
just running clojure-lsp format
on that I see all these other namespaces
should I create an issue mentioning that?
hehe no I'm another Andrea
@andrea.crotti I can't repro with your project for some reason :thinking_face:
Ah right
I have the latest version but didn't try with latest master
I think it was fixed by this commit: https://github.com/clojure-lsp/clojure-lsp/commit/eba6a4d07f17f97c788a585a2d249290be641ed3
@andrea.crotti Would you mind test on your projects as well the latest master clojure-lsp?
You can generate a clojure-lsp from master with just running make
on clojure-lsp project
mm I see the same issue
just pulled latest master
ah wait I deleted .clj-kondo
and tried again
and it doesn't do that now
so maybe it is fixed now actulaly
Hey, I'm currently using lsp for some personal projects for the first time in a while, and it's causing me some problems.
When I work on projects that provide clj-kondo configuration, I tend to create the project hooks and config in the resources/clj-kondo.exports
directory, as normal, but in my .clj-kondo
directory I symlink to those files so that I can use the configuration I'm exporting.
Every time I start lsp in a project like this though, it overwrites my symlinks as empty normal files
Is that intended, or a bug?
@suskeyhose There is a better solution for this than symlinks
clojure-lsp just create the .clj-kondo dir if not exists, nothing more besides that
Add {:config-paths ["../resources/clj-kondo.exports/org.your/your.lib"]}
to your config instead
maybe there's something more than just lsp, but it's only happening to me when I add +lsp
to my clojure module in doom
oh, duh. That makes sense.
For some reason it didn't occur to me to navigate up a directory
it's probably clj-kondo itself that's overwriting this as the result of lsp calling it with --copy-configs
We should probably document this trick in the import/export configs section. PR or issue welcome... it's too late for me to do this now :)
yeah, that fixed it