Skip to content
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

Requires with :refer :all cause unresolved symbols and unused namespace errors #30

Closed
chris opened this issue May 3, 2018 · 6 comments
Labels
documentation Better documentation needed. good first issue Good for newcomers under discussion

Comments

@chris
Copy link

chris commented May 3, 2018

I'm finding that if I use :refer :all in a namespace require, that Calva shows me some unexpected errors around unresolved symbols and unused namespace. For example, if I have:

(ns my.thing.user-test
  (:require [clojure.test :refer :all]))

Then assuming I have some tests defined, I will get the following errors:

Parse error: Unable to resolve symbol: deftest
Parse error: Unable to resolve symbol: is
Parse warning: unused namespace clojure.test

If I change my requires to use :as, or to list the referred items (e.g. [clojure.test :refer [deftest is testing use-fixtures]]), then the errors go away. I'm relatively new to Clojure, but these tests run fine, so it seems like a Calva parsing issue?

My environment:

  • MacOS
  • Calva 1.3.16
  • Joker 0.9.1
  • Clojure 1.9.0
  • Leiningen 2.8.1
  • cider/cider-nrepl 0.16.0
  • org.clojure/tools.nrepl 0.2.12
@pedrorgirardi
Copy link
Contributor

Hi @chris. I'm not familiar with Joker so I don't know if there is a workaround for that. If you use :refer [deftest] Joker doesn't complain about deftest nor about the unused namespace.

@pedrorgirardi
Copy link
Contributor

Yep, Joker can't resolve the symbols when using :refer :all. 😕 Check this issue: candid82/joker#52

@chris
Copy link
Author

chris commented May 3, 2018

Thanks @pedrorgirardi , ya per what I mentioned in there, it wasn't a problem if I directly refer the used functions, etc. so, not a big deal, but just wanted to mention it. I guess this is really a Joker issue instead of Calva. I can file it with them.

@chris chris closed this as completed May 3, 2018
@PEZ
Copy link
Collaborator

PEZ commented May 4, 2018

Thanks for letting us know, @chris. We maybe should add some note in the Calva README about it. Opening this issue again and we can close it when we have either added a note or decided against it.

@PEZ PEZ reopened this May 4, 2018
@PEZ PEZ added good first issue Good for newcomers documentation Better documentation needed. under discussion labels May 4, 2018
@kwladyka
Copy link

kwladyka commented May 4, 2018

IMO it is joker issue and should be discuss in joker issues github, not here. Unless we consider to change joker to something else. I guess not.

It is clearly said Calva use Joker to check it.

Besides of that we can have paragraph in readme:

Known dependency issues

Joker

But it would be a little redundancy with Joker issues. It can make sense only on early stage of Calva.

@chris
Copy link
Author

chris commented May 4, 2018

You could add something to the README to state that linter errors are from Joker, but really this was my fault for filing it here - I should have realized it was in Joker and looked there first. Other people may run into this too, and it's always a challenge when you have dependencies, so I think it's also fine to just know that if something like this comes up, it can be redirected to the dependency (Joker, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Better documentation needed. good first issue Good for newcomers under discussion
Projects
None yet
Development

No branches or pull requests

4 participants