lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
snoe 2020-03-26T01:22:58.023500Z

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")))

snoe 2020-03-26T01:43:49.023700Z

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)))))))

snoe 2020-03-26T01:53:24.024Z

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.