This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-20
Channels
- # aleph (1)
- # announcements (1)
- # aws (11)
- # babashka (117)
- # beginners (34)
- # calva (13)
- # cider (3)
- # clj-commons (8)
- # clj-kondo (24)
- # clj-yaml (36)
- # cljsrn (46)
- # clojure (50)
- # clojure-australia (5)
- # clojure-europe (239)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-spec (16)
- # clojurescript (25)
- # core-typed (20)
- # cursive (41)
- # datahike (1)
- # datalevin (1)
- # datomic (17)
- # fulcro (27)
- # hyperfiddle (35)
- # introduce-yourself (1)
- # jobs (4)
- # lsp (20)
- # malli (8)
- # meander (8)
- # nbb (1)
- # off-topic (31)
- # parinfer (9)
- # pathom (3)
- # portal (2)
- # re-frame (20)
- # react (2)
- # reagent (8)
- # releases (1)
- # remote-jobs (4)
- # scittle (2)
- # shadow-cljs (8)
- # slack-help (4)
- # sql (30)
- # squint (3)
- # tools-deps (34)
- # xtdb (21)
Not sure if this is a clj-kondo
or clojure-lsp
question but: why can't I interact with the ns
form similar to any other form? For example (in emacs) running lsp-find-references
or lsp-find-definition
on the ns
symbol provides nothing. Also, no docstrings or anything are provided for ns
(e.g. in a lsp-ui popup etc). If I navigate to clojure.core
, the lens for the ns
macro reports 0 references
. I can create a ticket if this is not a known issue already somewhere.
I think this is related to clj-kondo analysis, you can confirm that running lsp-clojure-cursor-info
on the ns
, it's areally helpful command to debug kondo analysis with LSP, you will see that for ns
there is no analysis
I have a repo structure like this:
root
front-end-1/
.lsp/
deps.edn
front-end-2/
.lsp/
deps.edn
shared-code/
.lsp/
deps.edn
shared-code
is referenced in both front-end-1
and front-end-2
in the deps.edn
file:
{:paths {shared/code {:local/root "../shared.code"}}
However, when I reference shared.code :as code
in front-end-1
or front-end-2
clojure-lsp warns:
(ns my.ns
(:require [shared.code :as code]))
(defn my-fn
[code/fn arg]) ; unresolved var: code/fn
Any thoughts on how to resolve this? Thanks in advance!!My suggestion for deps.edn project is:
• import the folder root
as the project root
• Add a root deps.edn with :dev
alias that points to all 3 projects
This is pretty similar to how clojure-lsp project is configured and it works pretty well, I suggest you use it as example: https://github.com/clojure-lsp/clojure-lsp/blob/master/deps.edn#L2-L17
If you still wanna follow with your current arch, we would need to understand what project-root your editor is sending to clojure-lsp and the classpath that is returning (you can check that via server logs)
Sweet. So, for the root lvl deps.edn
file you have: when you run the project in development, do you run the aliases in the root deps.edn or move into the sub projects and run the aliases from there.
More details https://clojure-lsp.io/settings/#classpath-scan and https://clojure-lsp.io/settings/#source-paths-discovery
ahh, sweet. So, is your deps.edn mainly to get clojure-lsp to pickup the sub projects correctly?
I think it's a good standard for any tool that relies on know what you use during development, but yeah, mainly for LSP tool
Thanks!! and I agree. For other projects I have, that's how I structure it. I was curious because it's helpful to know that we can add the top level one, but keep the others as is and just note that it's to satisfy tooling.
it's possible to not require the root one, telling clojure-lsp to cd && clj -Spath
via custom project-specs
but IMO it's harder to do and maintain
Found another Request textDocument/codeAction failed.
exception in Calva.
Repro: (`|` represents cursor)
clojure-lsp version used: 2022.09.20-16.33.44-nightly
{:foo b|}
Type <backspace>
to trigger.Thanks for the repro! I've been getting a few of the exception pop-ups, but have failed to see a reproducible pattern. I'll be on the alert if I see something that doesn't seem to be this particular one.
Oh, I can repro it only with Calva, that's interesting it does happen on a specific case, on both editors
Made a fix on master @U90R0EPHA