New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully qualified symbol in def referring to current namespace #1326
Projects
Comments
As I understand Michiel Borkent already has a workaround for this issue. |
A workaround using hooks: def_hook.clj: (ns def-hook
(:require [clj-kondo.hooks-api :as api]))
(defn transform-def [{:keys [:node]}]
(let [[name-node & arg-nodes] (rest (:children node))
name-sym (api/sexpr name-node)]
(when-not (simple-symbol? name-sym)
(let [new-node (with-meta
(api/list-node
(list*
(api/token-node 'def)
(api/token-node (symbol (name name-sym)))
arg-nodes))
(meta node))]
{:node new-node})))) {:hooks {:analyze-call {clojure.core/def def-hook/transform-def}}}
|
borkdude
changed the title
clj-kondo does not understand
Fully qualified symbol in def referring to current namespace
Jul 24, 2021
alias
borkdude
added a commit
that referenced
this issue
Jul 25, 2021
borkdude
added a commit
that referenced
this issue
Jul 25, 2021
@jimka2001 I decided to start supporting this one so we can get this out of the way while iterating on the macroexpand stuff. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
version
I am using the clojure-lsp plugin + lisp-mode for emacs.
platform
MacOS
editor
emacs
problem
I see several wrong errors and warnings.
When I use
alias
to make an alias to the current package, and thereafterprefix symbols with that alias, the analyser doesn't seem to recognize the names.
repro
expected behavior
I expect that
jt/xyz
be treated likexyz
ifjt
is aliased to the current namespace.The text was updated successfully, but these errors were encountered: