Skip to content

Commit

Permalink
Improve resolve-macro-as messages and default excluded symbols.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdallo committed Jul 17, 2021
1 parent 96c5e5b commit f0f863e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Editor
- Improve hover output, both markdown and plain text forms.
- Allow calling thread-first/last and thread-first-all/last-all from within the list.
- Improve resolve-macro-as messages and default excluded symbols.

- API/CLI
- Fix empty `XDG_CONFIG_HOME` not defaulting to `$HOME/.config` #474
Expand Down
15 changes: 11 additions & 4 deletions src/clojure_lsp/feature/resolve_macro.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@
[taoensso.timbre :as log]))

(def ^:private excluded-macros
'{clojure.test [deftest is testing]
clojure.core *})
'{clojure.core *
clojure.core.async *
clojure.test [deftest is testing]
clojure.test.check.generators [let]
cljs.core.async *
cljs.core.async.macros *
cats.core [->= ->>=]
schema.core [defschema]
compojure.core [defroutes let-routes]})

(defn ^:private find-function-name-position [uri row col]
(some-> (get-in @db/db [:documents uri :text])
Expand Down Expand Up @@ -62,5 +69,5 @@
:text (:text document)})
(log/info (format "Resolving macro as %s. Saving setting into %s" resolved-full-symbol-str kondo-config-path)))
(do
(log/error (format "Could not resolve macro '%s' for path '%s'" resolved-full-symbol-str kondo-config-path))
(producer/window-show-message (format "No macro '%s' was found to be resolved." resolved-full-symbol-str) :error))))
(log/error (format "Could not resolve macro at cursor to be resolved as '%s' for path '%s'" resolved-full-symbol-str kondo-config-path))
(producer/window-show-message (format "No macro was found at cursor to resolve as '%s'." resolved-full-symbol-str) :error))))

0 comments on commit f0f863e

Please sign in to comment.