👋 Is there a way to get clojure-lsp to recognize symbols imported using :refer-macros
in cljs files? I can work around it by requiring the namespace using :as
but I figured I'd ask to see if maybe I'm doing something wrong.
Hum, maybe a bug for clojurescript @snoe?
hrm yeah I dont think i did anything with refer-macros
or require-macros
it should work exactly like refer
. I think all our code just uses refer
these days .
Should I open an issue?
I think what you are looking for is: https://github.com/snoe/clojure-lsp#macro-defs
Example: https://github.com/ericdallo/dotfiles/blob/master/.lsp/config.edn#L38-L40
Yes, I've gotten clojure-lsp to recognize macros, and specifically the macro I'm requiring, but it still won't let me use the specific (:require [some-library :refer-macros [some-macro])
. If I use (:require [some-library :as sl]) (sl/some-macro foo)
then it detects the macro correctly with the macro-defs I've added. But I can use it directly as (some-macro foo)
with the :refer-macros
from clojurescript.
example code I'm working on https://github.com/BerkeleyTrue/reframe-todo-cljs/blob/61affdb40c/src/cljs/todo/views.cljs#L7
Hi all. I've been recommended to move the question i asked in #vim to here. I don't want repeat myself, so here's the link to the question. sorry for the confusion: https://clojurians.slack.com/archives/C0DF8R51A/p1601375358005700
Hey Ory, I just fixed a similar issue. You can define you macro-defs in the coc-settings.json under initializeOptions, or you can add a .lsp/config.edn
in your project root and add the defs there
see here https://github.com/BerkeleyTrue/reframe-todo-cljs/blob/master/.lsp/config.edn
thanks. i don't want to turn off unresolved symbols completely, just the special ones with ?...
for tabular
i'm trying this .lsp/config.edn
contents and it completely turned of clj-kondo for me
{"clj-kondo" {:linters {:unresolved-symbol {:exclude [(midje.sweet)]}}}
oh, the important part is the macro-defs
does it disable unknown symbol errors only for midje? or for everything?
the way you have it set up there would exclude all the symbols from midje.swee namespace. I don't think it is supposed to disable the all unresolved symbol linting. I'm not an expert either, so maybe someone else could chime in?