This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-06
Channels
- # announcements (7)
- # aws (8)
- # babashka (9)
- # babashka-sci-dev (11)
- # beginners (37)
- # calva (50)
- # cider (15)
- # clj-kondo (30)
- # clj-otel (3)
- # cljdoc (16)
- # cljs-dev (26)
- # cljsrn (4)
- # clojure (168)
- # clojure-doc (1)
- # clojure-europe (17)
- # clojure-gamedev (4)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-spec (17)
- # clojure-uk (16)
- # clojurescript (27)
- # community-development (3)
- # css (3)
- # cursive (9)
- # datomic (25)
- # emacs (1)
- # events (4)
- # fulcro (2)
- # google-cloud (2)
- # graphql (11)
- # gratitude (9)
- # humbleui (16)
- # hyperfiddle (2)
- # jobs (1)
- # london-clojurians (1)
- # lsp (16)
- # malli (2)
- # off-topic (71)
- # pedestal (4)
- # polylith (9)
- # portal (94)
- # reagent (6)
- # reitit (2)
- # releases (1)
- # remote-jobs (2)
- # sci (9)
- # shadow-cljs (49)
- # spacemacs (8)
- # tools-build (2)
- # tools-deps (39)
- # vim (7)
- # xtdb (6)
Hey folks, como vai?
Quick question: I recently ran clojure-lsp diagnostics on one personal project and discovered that it fails on (deftest named-test …)
saying that named-test
is an unresolved symbol. Is there a way to avoid that? I thought that the name of the test can be anything that I want 😢
it can be whatever name, pretty weird error, some double checks to do:
• what's your clojure-lsp --version?
• the same happens if you rm .clj-kondo/.cache
? if so try removing .lsp/.cache
as well
Thanks Eric, as always. You should be able to access to https://github.com/erickisos/audiotools/runs/6324675108?check_suite_focus=true, however I attached a screenshot with the exact same problem on local. The Github Action has this version (clojure-lsp-version: 2022.05.03-12.35.40)
I see, it seems to me that the reason is that you are using deftest from schema.test, not clojure.test
If that was really intended, you will need to instruct clj-kondo to lint that deftest macro as a clojure.test/deftest
Oh man, thanks, that was the problem
Something like this should work:
.clj-kondo/config.edn
{:lint-as {schema.test/deftest clojure.test/deftest}}
BTW this could be fixed on schema lib itself, exporting that config which clojure-lsp would copy automtically
@snoe, having the clojure-lsp.debug
namespace available was super helpful while https://github.com/clojure-lsp/clojure-lsp/issues/970#issuecomment-1119259297 a performance problem in clojure.core
. Thanks for the the encouragement to get that https://github.com/clojure-lsp/clojure-lsp/pull/944.
I have one other annoyance about using the nREPL—the test namespaces aren’t on the source paths / classpath, so you can’t easily run the tests as you change the implementation. To get around this I usually resort to switching back and forth between the clojure-lsp repl and a regular CIDER repl, which really breaks the flow.
Actually, it is possible to run the tests from the clojure-lsp nREPL, but you have to open clojure-lsp.test-helper
and cider-eval-buffer
first. That works because CIDER doesn’t care that clojure-lsp.test-helper
isn’t on the classpath. Then you can use the same trick to evaluate a test buffer, and then you can run tests.
@ericdallo I assume this could be fixed either by including more aliases in the build and/or by changing around the various deps.edn configurations. You have a much better sense of how that stuff fits together. Do you think it’s possible?
Or maybe by adding an additional path to the src-dirs
in the build? It’s all still sort of black magic to me.
Yeah, possible, I think we can include the test path on the debug profile, no problem I think
Forgot to mention this is already available, you can now connect to a running process repl and eval tests normally
I noticed when it was added and played with it briefly, I was able to run tests, which was nice, but then everything froze and I had to restart the editor. I’ll plan to experiment with it more sometime