This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-18
Channels
- # announcements (10)
- # babashka (21)
- # beginners (99)
- # biff (66)
- # catalyst (3)
- # cherry (1)
- # cider (11)
- # clojure (38)
- # clojure-austin (3)
- # clojure-dev (23)
- # clojure-europe (21)
- # clojure-hungary (10)
- # clojure-nl (2)
- # clojure-norway (57)
- # clojure-uk (2)
- # clojurescript (9)
- # cursive (6)
- # fulcro (5)
- # hyperfiddle (14)
- # integrant (4)
- # introduce-yourself (3)
- # lsp (24)
- # off-topic (14)
- # reagent (12)
- # reitit (13)
- # releases (8)
- # sci (16)
- # shadow-cljs (8)
- # solo-full-stack (1)
- # spacemacs (5)
- # squint (3)
- # xtdb (14)
I have a clj/cljs project with src
, test
, bin
, and bb
folders. In bin
are a few babashka scripts, and in bb/our-company/some-theme/…
is babashka code shared by the scripts in bin
. Everything works fine except I can’t figure out how to configure .clj-kondo/config.edn
to make lsp understand that the functions under bb
are used by scripts in bin
, i.e. I’m getting a lot of “Unused public var” warnings for the code under bb
. The other direction works fine, i.e. there are no “Unresolved var” lsp warnings in the scripts in bin
. Does anybody have any idea how this could be solved?
@UDQE4G9B2 Have you got a bb.edn
file?
Yes, and it starts with
{:paths ["bb"]
looks good, I think lsp should be able to pick up on that. did you restart your lsp server already?
else let's ping @UKFSJSM38 , perhaps he knows
yes, restarted several times while trying different variations of :include-files
in kondo’s config.
you can also check with clojure-lsp-server-info (if you're using emacs) to see what it's using
I’m in VSCode with Calva
sorry, the link should have been: https://clojure-lsp.io/settings/#classpath-scan
> Note that it's possible to have more than one project type at the same time e.g. deps + babashka, clojure-lsp will merge the classpath and everything should work fine.
I have found the lsp-server-info in Calva, and it includes:
…
"final-settings": {
"auto-add-ns-to-new-files?": true,
"document-formatting?": false,
"dependency-scheme": "jar",
"keep-require-at-start?": true,
"source-paths": [
"/Users/pekeler/Projects/redsky/redsky/bb",
"/Users/pekeler/Projects/redsky/redsky/src/clj",
"/Users/pekeler/Projects/redsky/redsky/test",
"/Users/pekeler/Projects/redsky/redsky/src/cljc",
"/Users/pekeler/Projects/redsky/redsky/resources",
"/Users/pekeler/Projects/redsky/redsky/src/cljs"
],
…
i.e. the bin
folder seems to be missing.That was it 😄 Thank you very much for your super fast help!
Just out of curiosity, does bb has default paths
? I think deps.edn has src
as default