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

defstate macro is not recognized as var definition #5

Closed
maxp opened this issue Apr 6, 2018 · 2 comments
Closed

defstate macro is not recognized as var definition #5

maxp opened this issue Apr 6, 2018 · 2 comments
Labels
documentation Better documentation needed.

Comments

@maxp
Copy link

maxp commented Apr 6, 2018

The defstate macro from mount.core used to define special kind of vars.
But the editor shows an error popup with message that myvar is not defined.

(defstate myvar
  :start ...
@maxp
Copy link
Author

maxp commented Apr 6, 2018

As workaround for this problem declare could be used.

(declare myvar)

(defstate myvar
  ...

@PEZ PEZ added the documentation Better documentation needed. label Apr 6, 2018
@PEZ
Copy link
Collaborator

PEZ commented Apr 6, 2018

You are running into a limitation of the Joker linter. It doesn't do a full scan of all files and does not recognize defstate (in your case) as a macro. But all is not lost! To get rid of the error messages, add defstate to Joker's list of known macros. Create a .joker file somewhere in the path from the root of your project to where you are using the macro (I prefer to have it in the project root), and add:

{:known-macros [some-ns/defstate]}

Replace some-ns with whatever namespace you are requiring the macro from. Read more about Joker's linter mode here: https://github.com/candid82/joker#linter-mode

Please let me know if this solves your issue, and close the issue if so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Better documentation needed.
Projects
None yet
Development

No branches or pull requests

2 participants