BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.57k stars 213 forks source link

Incorrect squiggle with macro quotes #2564

Open rongcuid opened 3 weeks ago

rongcuid commented 3 weeks ago

The following is valid Clojure:

(defmacro foo [xs]
  (list println `'~xs))
(foo (a b))

However, the error squiggle is incorrect: Screenshot from 2024-06-06 12-01-01

PEZ commented 1 week ago

Hi! Thanks for reporting. This is better brought up with clj-kondo:

$ clj-kondo --lint - << 'EOF'
(defmacro foo [xs]
  (list println `'~xs))
(foo (a b))
EOF
<stdin>:3:9: error: Unresolved symbol: a
<stdin>:3:11: error: Unresolved symbol: b
linting took 33ms, errors: 2, warnings: 0

Maybe @borkdude can tell us wether he wants an issue there or if there is some reason why the default lint rules do this.

borkdude commented 1 week ago

Do you mean you consider it a bug that a and b are unresolved symbols?

You need to configure clj-kondo for your custom macros. You can read more about that here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#unrecognized-macros