This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-05
Channels
- # announcements (1)
- # babashka (5)
- # beginners (151)
- # calva (43)
- # clj-kondo (23)
- # cljdoc (1)
- # cljs-dev (6)
- # cljsrn (10)
- # clojure (60)
- # clojure-australia (1)
- # clojure-europe (26)
- # clojure-gamedev (14)
- # clojure-nl (1)
- # clojure-spec (10)
- # clojure-uk (80)
- # clojurescript (66)
- # clojureverse-ops (4)
- # community-development (7)
- # conjure (8)
- # datomic (15)
- # deps-new (1)
- # docker (27)
- # emacs (2)
- # fulcro (13)
- # honeysql (13)
- # java (5)
- # jobs-discuss (43)
- # lsp (121)
- # luminus (13)
- # malli (1)
- # off-topic (73)
- # pathom (12)
- # polylith (29)
- # practicalli (4)
- # re-frame (35)
- # reagent (44)
- # remote-jobs (5)
- # rewrite-clj (2)
- # sci (7)
- # shadow-cljs (125)
- # sql (4)
- # tools-deps (9)
- # xtdb (5)
does/should the lint-project-files-after-startup?
setting affect the "linting unused public vars" feature at startup or should that be controlled separately with the :linters
settings?
asking because Linting unused public vars for whole project took 382950ms
😅
if lint-project-files-after-startup?
is enabled (true as default), it will lint all files from your project to have informations like how many errors/warnings your project has, exmple on emacs modeline:
this is the heavier feature of clojure-lsp and depends on the project size, I tested on one of the biggest services on Nubank, and took 391838ms
, but Remeber this run async and should not affect performance that much
TLDR the exception was that I was not using async/>!
but async/put!
which doesn't have backpressure 😅
I dread the day I must do something non-trivial with core.async, I can barely write working synchronous code 🙂
yeah, clojure-lsp is not a heavy case of async, but I already learned a lot of async with it 😛
hmm... I added :linters {:unused-public-var {:level :off}}
to my .lsp/config.edn
but it seems clojure-lsp still performs the unused var linting. was this a known issue or am I doing something wrong?
oh, I need to update the docs about that, if you want to disable the public lint, you need to do that on clj-kondo side, add {:linters {:clojure-lsp/unused-public-var {:level :off}}}
to your .clj-kondo/config.edn
hmm.. that did not seem to have any effect. I assume the clj-kondo config is read when I restart emacs and not cached anywhere?
yeah. or more precisely: I don't want clojure-lsp
to consume one of my cpu cores for ~5 minutes every time I (re)start emacs and I assume that the culprit is that unused-public-var
linting
I've already done that
(or at least I've attempted to do that)
hum, I just checked the code, and I found the performance issue is some lines before that one
I assume that :lint-project-files-after-startup? false
is doing something, because I no longer get those "a/b/c" counters for the errors and warnings
I made a fix on master https://github.com/clojure-lsp/clojure-lsp/commit/0e279b54a31364ceaae70e085e4107a8a212780f
Just like I mentioned here: https://github.com/clojure-lsp/clojure-lsp/issues/506#issuecomment-893520237
sure, I'll report back my findings 👍
the issue seems to be resolved 🎉
Good 🙂 I have plans to improve somehow that part of clojure-lsp, but i'll not be an easy task
I also noticed that a) it seems to be running over java (as you mentioned) and b) the "analyzing source paths" parts was about 30% faster than previously (22 seconds vs. 35) and it used multiple cores simultaneously
hum, let's wait next release (I'll do a fix release soon) to test the graalvm binary one
sure. Can I try to do the graalvm build or does it require some additional magic/setup?
seems to be working ok.
The "analyzing source paths" seems to be running on a single core and as such takes a bit longer than the java version (32 seconds on native). And if I re-enable the :lint-project-files-after-startup?
flag we get back to the "single core saturated for ~5 minutes" situation (for both the java and the native image).
those fast "didOpen", "documentHighlight" et al seem to be quite a bit faster on the native version vs. the java (no surprise there)
yeah, graal takes a little more time for those analysis but consume less resources in general
Released 2021.08.05-18.25.54 with just minor fixes related to previous release:
• Fix async project lint after startup for huge projects. https://github.com/clojure-lsp/clojure-lsp/issues/506
• Fix :lint-project-files-after-startup?
to be considered before clojure-lsp lint unusued public vars.
• Fix excluded symbols for code lens, making clojure-lsp check clj-kondo config as well for the linter :clojure-lsp/unused-public-var
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
Uncaught exception: Header must provide a Content-Length property.
from here: https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.08.05-18.25.54
A whole screen full of Uncaught exception: Header must provide a Content-Length property.
2021-08-05T18:59:33.957Z daffy INFO [clojure-lsp.server:410] - Starting server...
2021-08-05T18:59:33.959Z daffy INFO [clojure-lsp.nrepl:21] - ====== LSP nrepl server started on port 39019
2021-08-05T18:59:33.962Z daffy INFO [clojure-lsp.server:295] - Initializing...
2021-08-05T18:59:33.975Z daffy INFO [clojure-lsp.source-paths:137] - Using given source-paths: ["src" "test"]
2021-08-05T18:59:39.670Z daffy INFO [clojure-lsp.crawler:162] - Analyzing source paths for project root /home/david/development/workspaces/foo
2021-08-05T18:59:41.818Z daffy INFO [clojure-lsp.crawler:121] - Paths analyzed, took 2.1473644 secs. Caching for next startups...
2021-08-05T18:59:41.947Z daffy DEBUG [clojure-lsp.server:?] - :initialize 7984ms
2021-08-05T18:59:41.955Z daffy INFO [clojure-lsp.server:341] - Initialized!
2021-08-05T18:59:41.955Z daffy DEBUG [clojure-lsp.server:?] - :initialized 0ms
2021-08-05T18:59:41.987Z daffy DEBUG [clojure-lsp.server:?] - :didOpen 31ms
2021-08-05T18:59:42.155Z daffy DEBUG [clojure-lsp.server:?] - :didOpen 167ms
2021-08-05T18:59:42.324Z daffy DEBUG [clojure-lsp.server:?] - :codeLens 5ms
2021-08-05T18:59:43.961Z daffy DEBUG [clojure-lsp.server:?] - :semanticTokensFull 5ms
2021-08-05T18:59:45.007Z daffy WARN [clojure-lsp.feature.diagnostics:85] - Invalid clj-kondo finding. Cannot find position data for {:type :unresolved-var, :filename "/home/david/development/workspaces/foo/redis.clj", :message "Unresolved var: mapv", :row nil, :col nil, :end-row nil, :end-col nil, :level :warning}
2021-08-05T18:59:45.064Z daffy INFO [clojure-lsp.feature.diagnostics:148] - Linting whole project files took 3258ms
because clojure-lsp is sending/receiving the same data, the integration-tests prove that
maybe @UEENNMX0T can test latest release with vim?
Well, all I can do is report what I see. The release of 2 days ago works. Todays release does not.
i upgraded to the same version @U11EL3P9U and don’t see any errors in my coc.nvim logs
glad to help
one missing println
This doesn't fail on emacs because lsp-mode safelly handle the server response while neovim seems to doesn't like
@U11EL3P9U Would you mind testing the clojure-lsp master? you can generate the binary with just make