This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-26
Channels
- # babashka (63)
- # beginners (27)
- # calva (17)
- # cider (1)
- # clojure (23)
- # clojure-europe (6)
- # clojure-norway (4)
- # clojurescript (9)
- # cursive (8)
- # data-oriented-programming (9)
- # data-science (7)
- # fulcro (14)
- # graalvm (3)
- # helix (3)
- # introduce-yourself (1)
- # jobs-discuss (7)
- # membrane (40)
- # missionary (4)
- # off-topic (32)
- # pathom (60)
- # react (6)
- # releases (2)
- # shadow-cljs (4)
I'm trying to use the "Resolve macro as" code action by clicking the lightbulb. I choose to resolve as defn, and getting an error "No macro was found at cursor to resolve as 'clojure.core/defn'.". The macro is definintely there as I'm using the context lightbulb action, and it happens on mac and ubuntu. What should I look for to troubleshoot this?
Let's see if @U9A1RLFNV has some idea about what to do here. Might be a bug we need to fix.
I just tried this out and sometimes it worked, sometimes it didn’t. I’m not sure what could be causing it to not work, aside from stale clojure-lsp analysis data. CC @UKFSJSM38
For example, after it didn’t work, I edited the file to cause clojure-lsp to re-analyze the file, and then it worked, but I can’t say that consistently made it work after not working.
In a file with this code in it, the command always worked on the first deftest
, but sometimes failed on the second.
(ns core-test
(:require [clojure.test :refer [is deftest]]))
(deftest test-1
(is true))
(deftest test-2
(is (= 1 1)))
I created an issue here: https://github.com/BetterThanTomorrow/calva/issues/1788
I noticed that if I put the cursor after the t
in deftest
the command always fails, but if I put it before the t
, the command always succeeds.
I commented on the issue that Calva could send a selection for what it thinks is the relevant symbol. Then it would correspond to Calva user expectations.
Yeah, but that should be handled by server IMO, we already do that for most refactorings, probably there is room to improvement on clojure-lsp side if that's the issue indeed
Yeah, it does seem like deftest
is a reasonable symbol to use for both those cases. Regardless of editor.
Hi guys, I think PR https://github.com/clojure-lsp/clojure-lsp/pull/1179 might resolve this issue.