This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-09
Channels
- # aleph (1)
- # announcements (4)
- # asami (6)
- # babashka (45)
- # beginners (19)
- # biff (3)
- # calva (35)
- # cider (4)
- # clojars (5)
- # clojure (117)
- # clojure-art (3)
- # clojure-denmark (2)
- # clojure-europe (89)
- # clojure-gamedev (5)
- # clojure-nl (4)
- # clojure-norway (17)
- # clojure-spec (3)
- # clojure-uk (5)
- # clojurescript (84)
- # conjure (13)
- # datomic (11)
- # emacs (2)
- # figwheel (2)
- # fulcro (16)
- # graphql (5)
- # honeysql (7)
- # introduce-yourself (1)
- # lsp (86)
- # malli (16)
- # music (1)
- # off-topic (2)
- # pathom (14)
- # polylith (28)
- # re-frame (11)
- # reagent (23)
- # releases (1)
- # reveal (19)
- # shadow-cljs (72)
- # spacemacs (13)
- # sql (1)
- # test-check (3)
- # timbre (4)
- # tools-deps (45)
- # vim (18)
Anyone using corfu + LSP? Completions in this form ns/some-fn
don't auto-complete the fn name
https://github.com/clojure-emacs/cider/issues/3019 Ah this might be related
Hey @U050SC7SV, do your auto completions for ns/complete-this-fn-name
? Gif?
Also my point was: maybe I can use cider's hacks for filtering the results/supporting the /
separators for ns vs value
Oh wow, mind linking your config again? I couldn't find it in my history
(Not related to corfu) I've also noticed that core and 3rd party fns doc strings don't show up anymore. Is this just me?
I don't recall having this problem, works on my machine âąïž
Which version of clojure-lsp are you using?
the latest nightly build đ
have you checked your lsp logs? perhaps the classpath scanning fails to find the 3rd party jars?
Ah, weird, same: https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.02.23-12.12.12 Anything I can specifically look for, in the lsp logs?
Classpath found, paths: [ <here be a bunch of paths to jars> ]
it should list your local source paths (`"/home/user/project/src/clj/package"`) and libs (`"/home/user/.m2/repository/com/foo/bar/some-lib.jar"`)
Hmm I don't see that log message đ (I searched for Classpath found
)
Weird, here's what mine looks like
2022-03-09T08:53:31.600Z INFO [clojure-lsp.server:552] - Starting server...
2022-03-09T08:53:31.603Z DEBUG [clojure-lsp.nrepl:21] - nrepl not found, skipping nrepl server start...
2022-03-09T08:53:31.607Z INFO [clojure-lsp.server:341] - Initializing...
2022-03-09T08:53:31.621Z INFO [clojure-lsp.db:?] - Reading transit analysis cache from db took 0.00 secs
2022-03-09T08:53:31.628Z INFO [clojure-lsp.crawler:178] - Using cached db for project root /home/anonimito/work/audience-republic/server-4
2022-03-09T08:53:31.628Z INFO [clojure-lsp.source-paths:214] - Using default source-paths: #{"src" "test"}
2022-03-09T08:53:31.628Z INFO [clojure-lsp.crawler:210] - Analyzing source paths for project root /home/anonimito/work/audience-republic/server-4
2022-03-09T08:53:31.629Z INFO [clojure-lsp.feature.clojuredocs:40] - Refreshing clojuredocs cache...
2022-03-09T08:53:33.756Z INFO [clojure-lsp.feature.clojuredocs:?] - Refreshing clojuredocs cache took 2.13 secs.
2022-03-09T08:53:41.523Z INFO [clojure-lsp.crawler:?] - Project only paths analyzed, took 9.89 secs
2022-03-09T08:53:42.450Z INFO [clojure-lsp.crawler:215] - Analyzing test paths for project root /home/anonimito/work/audience-republic/server-4
2022-03-09T08:53:42.451Z DEBUG [clojure-lsp.server:?] - :initialize 10843ms
2022-03-09T08:53:42.463Z INFO [clojure-lsp.server:394] - Initialized!
2022-03-09T08:53:42.464Z DEBUG [clojure-lsp.server:?] - :initialized 0ms
2022-03-09T08:53:42.543Z DEBUG [clojure-lsp.server:?] - :didOpen 75ms
2022-03-09T08:53:42.559Z INFO [clojure-lsp.server:?] - Refreshing testTree took 0.02 secs
2022-03-09T08:53:42.565Z DEBUG [clojure-lsp.server:?] - :codeLens 20ms
2022-03-09T08:53:43.103Z DEBUG [clojure-lsp.server:?] - :codeLens 544ms
2022-03-09T08:53:43.103Z DEBUG [clojure-lsp.server:?] - :codeLens 559ms
2022-03-09T08:53:43.135Z DEBUG [clojure-lsp.server:?] - :codeAction 590ms
2022-03-09T08:53:43.148Z DEBUG [clojure-lsp.server:?] - :resolveCodeLens 20ms
2022-03-09T08:53:45.980Z INFO [clojure-lsp.server:?] - Refreshing testTree took 3.53 secs
Ok, I see that log message after I wiped the cache
2022-03-09T08:55:10.551Z INFO [clojure-lsp.server:552] - Starting server...
2022-03-09T08:55:10.553Z DEBUG [clojure-lsp.nrepl:21] - nrepl not found, skipping nrepl server start...
2022-03-09T08:55:10.557Z INFO [clojure-lsp.server:341] - Initializing...
2022-03-09T08:55:10.570Z ERROR [clojure-lsp.db:80] - No cache DB file found
2022-03-09T08:55:10.571Z INFO [clojure-lsp.db:?] - Reading transit analysis cache from db took 0.00 secs
2022-03-09T08:55:10.581Z INFO [clojure-lsp.classpath:53] - Finding classpath via `lein with-profile +test,+dev classpath`
2022-03-09T08:55:13.159Z DEBUG [clojure-lsp.classpath:65] - Classpath found, paths: ["/home/anonimito/work/audience-republic/server-4/.cpcache/6D1005E097D9EA5E33FBD0BCB6BDC880.jar"]
2022-03-09T08:55:13.160Z INFO [clojure-lsp.source-paths:214] - Using default source-paths: #{"src" "test"}
but docstring still doesn't show up (I tried conj
)that's a leiningen project, right?
I'm no expert on lsp, but I would think that it should list more than just that 6D1005E097D9EA5E33FBD0BCB6BDC880.jar
. On my project I get over 100 lines of jars, including my own sources.
are you using some exotic lein profile(s) to pull in your dependencies?
Ah fair enough, @UKFSJSM38 any ideas why?
Hmm, not too sure, I wasn't the one who set it up
I might try with a non-lein project and see
in the log you can see how LSP tries to find out your classpath: lein with-profile +test,+dev classpath
. You can call that from the command line and it should print what the lsp logs show.
but I would imagine it should list a lot of stuff
Ok yea with a non-lein project it's fine
$ lein with-profile +test,+dev classpath
/home/anonimito/work/audience-republic/server-4/.cpcache/6D1005E097D9EA5E33FBD0BCB6BDC880.jar
can you share your project.clj
? If I had to guess I'd say you project uses some additional profiles to pull-in your actual dependencies.
Unfortunately I can't, since it's a proprietary project đ Weirdly, it was working weeks/months back. What changed in terms of retrieving classpaths?
do you supply any special profiles when running the app or starting a repl? lein with-profile +foo +bar run
but we didn't change anything recently related to that, it's more a lein responsibility bringing the classpath
I see, yea this is weird
$ lein classpath
/home/anonimito/work/audience-republic/server-4/.cpcache/95D2770C28E5B5B672E05FFA5B07A7A2.jar
I opened up that JAR and found this Any way for LSP to make sense of this?
I don't think so, AFAIK .cpcache it's a clojure folder, not related with lein, we need to understand why lein classpath is returning that for that project
Yeah weird, I searched around in lein's repo and didn't really find relevant occurrences of cache
Yeah I've tried multiple times, it just recreates it
I don't have a deps.edn in the project, but I do have a ~/.clojure.deps.den
- I'll try removing
Didn't work. Any way to verify if a project is using some deps.edn?
clojure -Spath
src:/home/anonimito/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar:/home/anonimito/.m2/repository/org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar:/home/anonimito/.m2/repository/org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar
Hmm, that's not complete at all
Ok thanks, good idea
but my own fns' docstrings do
Hello! Does someone know the reason why unused symbols are not colored differently? The same can be said for namespaces function and etc. To my knowledge clj-kondo should do handle this part and I have it installed as part of the calva extension.
This happens to me as well, now and then. I haven't seen a pattern other than that it is more common in my work project which is a quite huge monorepo. And it's not isolated to linting. I think it is the analysis as such.
Not aware of any bug like this, sounds like calva not analyzing that file or something
Hmmm, what did you refer to about the repro? I had just started talking about semantic tokens in ns forms, but now Slack tells me I couldn't send it...
In any case. Sent that as a separate message now. I can repro that one. This stuff with analysis sometimes not happening I have no clue how to repro. It's been happening for a while, but I can't see a pattern to it at all.
For this one, check if didOpen
was sent properly to server, and if clojure-lsp is returning diagnostics
/semantic-tokens for that file
another thing I noticed is that if I decide to use a function or symbols which are not declared, no visual warning is displayed in any way. I have to eval the file/function and check the repl for errors
@yuner.bekir mentions the ns
form, btw. The semantic tokenizing of keywords doesn't happen there. But for other keywords it does. Want an issue?
Yeah, it seems clj-kondo doesn't return a keyword analysis for :require, is that on purpose somehow @U04V15CAJ?
Without keyword analysis we can't know that keyword and not offer color and other features, so IMO we should consider it
thank you @U0ETXRFEW!
thanks! If anyone feels like a PR, please do, else I hope to get it in before next release
I'd like to give it a shot, but am a bit tied up with trying to prevent more fire fighting in Calva land.
Now I've spent some time to try figure out how to make my failing test pass, but I fail. đ I probably won't find time to spend on this again, so don't hold off fixing it @U04V15CAJ.
Hi folks. When a function is redefined, shouldnât its first definition get the unused font, rather than the first? As Clojure is evaluated from top to bottom, the last defintion âwinsâ. Example:
(defn foo
[])
;; this gets the unused font
(defn foo
[])
(defn bar []
(foo))
(slack is having trouble to upload images)