I'm not sure I follow, although my footing here is not deep. defmacro
can do io during expansion, iirc it's not possible to know what a macro will do without a runtime. I think something like this is valid (not at repl): (defmacro x [] (read-string (slurp "f")))
So that macro-def seems to work with your example
(deftest custom-sub-forms
(let [code "(ns f (:require [midje.sweet :as ms]))
(ms/fact \"foo\"
(let [a (blah c)]
(bar a) => 1
(baz a false) => nil))"
usages (parser/find-usages code :clj {'midje.sweet/fact [{:element :bound-elements :sub-forms {'=> [] 'provided [:elements]}}]})]
(is (= #{:scoped} (set (mapcat :tags (filter (comp #{"=>"} :str) usages)))))))
how are you defining the macro-def for fact? in .lsp/config.edn
? if you are doing it in a client's initializationOptions
the json decoding in lsp could be dropping the symbol incorrectly.