This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-27
Channels
- # announcements (1)
- # aws (8)
- # babashka (77)
- # babashka-sci-dev (8)
- # beginners (29)
- # biff (2)
- # calva (13)
- # cljs-dev (1)
- # clojure (42)
- # clojure-europe (205)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojurescript (58)
- # conjure (9)
- # data-science (7)
- # datalevin (19)
- # datomic (3)
- # emacs (7)
- # fulcro (15)
- # gratitude (8)
- # lsp (52)
- # meander (3)
- # membrane (92)
- # off-topic (12)
- # re-frame (16)
- # reagent (4)
- # reitit (15)
- # releases (1)
- # sci (30)
- # shadow-cljs (34)
- # tools-deps (5)
- # xtdb (17)
Posted in a similar issue but wouldn't mind some realtime debugging. In short, I'm running a shadow-cljs project with neovim. If I hover over a core function, I don't get much info about it. But if I hover over one of my project functions, I get all the details.
That looks like a classpath scan fail. Latest clojure-lsp warns about that fail during start with a option to retry. You can check if that was your case checking the server logs
Will look at that now, thanks!
Updated my config to log to /tmp/clojure-lsp.out, no classpath error detected
2022-09-27T17:08:54.422Z INFO [clojure-lsp.crawler:70] - [Startup] Project only paths analyzed by clj-kondo, took 150ms
2022-09-27T17:08:54.423Z INFO [clojure-lsp.dep-graph:300] - :maintain-dep-graph 0ms
2022-09-27T17:08:54.424Z INFO [clojure-lsp.handlers:107] - [Startup] Analyzing test paths for project root file:///Users/j/projects/crunchy-price-calc
2022-09-27T17:08:54.424Z INFO [clojure-lsp.feature.clojuredocs:21] - [Clojuredocs] Refreshing clojuredocs cache...
2022-09-27T17:08:54.424Z INFO [clojure-lsp.handlers:84] - :initialize 424ms
2022-09-27T17:08:54.426Z INFO [clojure-lsp.feature.java-interop:222] - [Java] JDK source already present on global LSP cache dir.
2022-09-27T17:08:54.427Z DEBUG [clojure-lsp.server:86] - Publishing 0 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/tasks/build.cljs
2022-09-27T17:08:54.428Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.428Z DEBUG [clojure-lsp.server:86] - Publishing 1 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/tasks/fetch.cljs
2022-09-27T17:08:54.428Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.429Z DEBUG [clojure-lsp.server:86] - Publishing 0 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/assets.cljs
2022-09-27T17:08:54.429Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.429Z DEBUG [clojure-lsp.server:86] - Publishing 14 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/price_calc/app/views.cljs
2022-09-27T17:08:54.429Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.429Z DEBUG [clojure-lsp.server:86] - Publishing 1 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/price_calc/app/storage.cljs
2022-09-27T17:08:54.429Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.430Z DEBUG [clojure-lsp.server:86] - Publishing 0 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/price_calc/app/format.cljs
2022-09-27T17:08:54.430Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.430Z DEBUG [clojure-lsp.server:86] - Publishing 1 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/price_calc/app/core.cljs
2022-09-27T17:08:54.430Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.430Z DEBUG [clojure-lsp.server:86] - Publishing 0 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/price_calc/root.cljs
2022-09-27T17:08:54.431Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.436Z INFO [clojure-lsp.server:437] - Initialized!
2022-09-27T17:08:54.530Z INFO [clojure-lsp.db:67] - [DB] Reading transit analysis cache from /Users/j/.cache/clojure-lsp/db.transit.json db took 104ms
2022-09-27T17:08:54.530Z DEBUG [clojure-lsp.server:86] - Publishing 0 diagnostics for file:///Users/j/projects/crunchy-price-calc/src/crunchy/price_calc/data/cloud_services.cljs
2022-09-27T17:08:54.530Z INFO [clojure-lsp.dep-graph:300] - :maintain-dep-graph 0ms
2022-09-27T17:08:54.530Z INFO [clojure-lsp.server:87] - :publish-diagnostics 0ms
2022-09-27T17:08:54.530Z INFO [clojure-lsp.feature.java-interop:256] - [Java] JDK source cached loaded successfully.
2022-09-27T17:08:54.579Z INFO [clojure-lsp.dep-graph:300] - :maintain-dep-graph 0ms
2022-09-27T17:08:54.580Z WARN [clojure-lsp.kondo:298] - Non-fatal error from clj-kondo: No configs copied.
The classpath log should be before those lines š
before [Startup] Project only paths analyzed by clj-kondo
My mistake! Looking now
2022-09-27T17:51:32.104Z INFO [clojure-lsp.db:67] - [DB] Reading transit analysis cache from /Users/j/projects/crunchy-price-calc/.lsp/.cache/db.transit.json db took 130ms
2022-09-27T17:51:32.130Z INFO [clojure-lsp.dep-graph:300] - :maintain-dep-graph 26ms
2022-09-27T17:51:32.206Z INFO [clojure-lsp.crawler:205] - [Startup] Using cached db for project root /Users/j/projects/crunchy-price-calc
2022-09-27T17:51:32.206Z INFO [clojure-lsp.source-paths:73] - [Startup] Using source-paths from classpath: ["/Users/j/projects/crunchy-price-calc/test" "/Users/j/projects/crunchy-price-calc/src"]
2022-09-27T17:51:32.207Z INFO [clojure-lsp.crawler:113] - Copying kondo configs from classpath to project if any...
2022-09-27T17:51:32.277Z WARN [clojure-lsp.kondo:298] - Non-fatal error from clj-kondo: Configs copied:
- .clj-kondo/babashka/sci
- .clj-kondo/funcool/promesa
- .clj-kondo/rewrite-clj/rewrite-clj
2022-09-27T17:51:32.277Z INFO [clojure-lsp.crawler:115] - Copied kondo configs, took 70ms secs.
2022-09-27T17:51:32.277Z INFO [clojure-lsp.crawler:237] - [Startup] Analyzing source paths for project root /Users/j/projects/crunchy-price-calc
2022-09-27T17:51:32.278Z INFO [clojure-lsp.crawler:74] - [Startup] Project only paths analyzed by clj-depend, took 0ms
shadow-cljs.edn
{:dependencies
[[reagent "1.1.1"]
[funcool/promesa "8.0.450"]
[zprint "1.2.4"]]
:source-paths
["src"]
:dev-http {3080 "public"}
:builds
{:app {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:entries [crunchy.price-calc.app.core]
:init-fn crunchy.price-calc.app.core/main}}
:release {:compiler-options {:optimiations :advanced}}}}}
deps.edn
{:paths ["src"]
:deps {funcool/promesa {:mvn/version "8.0.450"}
reagent/reagent {:mvn/version "1.1.1"}
zprint/zprint {:mvn/version "1.2.4"}}}
Could it be because I have a deps.edn for kondo, that it's skipping the shadow cljs npx shadow-cljs classpath
cmd?
Experimented with adding clojurescript to deps.edn. That seemed to have triggered a cache update, as once I restarted neovim I saw the following:
2022-09-27T18:00:12.846Z DEBUG [clojure-lsp.classpath:115] - Classpath found, paths: ["test" "src" ... (goes on for a while)]
2022-09-27T18:00:12.847Z INFO [clojure-lsp.classpath:103] - Finding classpath via `/Users/j/.asdf/shims/npx shadow-cljs classpath`
2022-09-27T18:00:13.743Z DEBUG [clojure-lsp.classpath:115] - Classpath found, paths: ["src" ... (goes on for a while)]
Working again
Removed the dep and is still working, seems it was just a caching issue of some kind.
Humm, yep, for some reason clojure-lsp didn't re-calculate the classpath and was using a old cache, sounds like a bug :thinking_face:
Now that that's solved š , how does the clojuredocs integration work? Is that a custom request to clojure-lsp or does it enhance one of those standard lsp server request features?
it's a custom request clojure-lsp does after startup and keep cache of whole clojuredocs info :)
I see, then provides two possible requests? ⢠find-docs-for ⢠find-hover-docs-for
> Whether to get clojuredocs information on hover, the clojuredocs content is cached.
So with the {:hover {:clojuredocs true}}
default, it should show clojuredocs content in the textDocument/hover request?
With the default settings, seems I only get info from the docstr and signature in hover and not seeing any clojuredocs content there
Checking
2022-09-27T18:00:22.580Z INFO [clojure-lsp.feature.clojuredocs:21] - [Clojuredocs] Refreshing clojuredocs cache...
Server requests clojuredocs after startup and bring a edn with all cljdocs info, usually this takes a few secs only and we have a retry mechanism but almost is never triggered, only for low networks
2022-09-27T18:00:23.294Z INFO [clojure-lsp.feature.clojuredocs:23] - [Clojuredocs] Refreshing clojuredocs cache took 714ms.
is the only other one that mentions clojuredocs that I seeI guess I expected it to use clojuredocs still. I'll try a clojure project
There is nothing about cljs on https://clojuredocs.org/
Wouldn't it be the same content?
Ah yeah just found that too
Seems that way, I'll give it a shot. Thanks for the help! Was throwing me off for a while there š