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

“Wrong number of arguments: (4 . 4), 0” appears again! #62

Open
FaiChou opened this issue Nov 7, 2019 · 6 comments
Open

“Wrong number of arguments: (4 . 4), 0” appears again! #62

FaiChou opened this issue Nov 7, 2019 · 6 comments

Comments

@FaiChou
Copy link

FaiChou commented Nov 7, 2019

Tested on:

macOS Catalina 10.15
elpa: 26.1
Cider version: 0.22.0 and 20191103.1528
flycheck-clojure version: 20190611.2351
flycheck version: 20191028.2247 

Opening cider-jack-in when in a clj file of a clj project, it always pop up errors when typing any character :

Wrong number of arguments: (4 . 4), 0
Error from syntax checker clojure-cider-eastwood: Done with no errors

Using purcell's config.

And tested with:

;; Local Variables:
;; indent-tabs-mode: nil
;; flycheck-disabled-checker: (clojure-cider-eastwood)
;; End:
@pnf
Copy link
Contributor

pnf commented Nov 8, 2019

I definitely can't reproduce this on the sample project in this repo. From the *Messages* buffer:

[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[acyclic/squiggly-clojure\ \"0.1.9-SNAPSHOT\"\] -- update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.3\"\] -- repl :headless :host localhost
[nREPL] server started on 49846
[nREPL] Establishing direct connection to localhost:49846 ...
[nREPL] Direct connection to localhost:49846 established

and then the expected flycheck highlighting:
image

By the way, if you are trying to disable eastwood, the local variable for disabling checkers has a final s in its name.

If you can give me a self-contained repro, I'll investigate further.

@eamonnsullivan
Copy link

One way to reproduce this easily for me is to clone clojure-koans (https://github.com/functional-koans/clojure-koans), open one of the files and start cider. Editing becomes painfully slow and I get repeated errors in the Messages buffer:
error in process filter: Wrong number of arguments: (4 . 4), 0 [2 times]
Error from syntax checker clojure-cider-eastwood: Done with no errors

If I disable eastwood (add it to flycheck-disabled-checkers), the same error just comes out of the next checker (kibit, I think) and so on. I just have to disable flycheck-mode when working on some repos.

@pnf
Copy link
Contributor

pnf commented Dec 15, 2019

I'm pretty sure that this is due to clojure/tools.reader no longer being provided as part of CIDER. As always, you can verify such theories by looking in the *nrepl-messages-... buffer for the clojure command preceding the error, and pasting it manually into the repl. You will probably see a FileNotFoundException from kibit, which uses tools.reader but presumably was counting on CIDER to provide it.

Nobody ever reported testing #59, but I've gone ahead and merged it. If you don't want to wait for it to clear MELPA, the main change is commenting out the exclusion in at line 204 of flycheck-clojure.el:

 ;;(cider-add-to-alist 'cider-jack-in-dependencies-exclusions "acyclic/squiggly-clojure" '("org.clojure/tools.reader"))

After restarting emacs and jacking in, you'll see that \:exclusions\ \[org.clojure/tools.reader\]\] is no longer part of the lein startup, and (hopefully) you won't get the "Wrong number of arguments" error.

@eamonnsullivan
Copy link

eamonnsullivan commented Dec 15, 2019

Yeah, that sounds like the issue:
err "Syntax error (FileNotFoundException) compiling at (reader.clj:1:1). Could not locate clojure/tools/reader__init.class, clojure/tools/reader.clj or clojure/tools/reader.cljc on classpath. " Thanks. I will try out the fix.

@eamonnsullivan
Copy link

I commented out that line and it worked for me. Thank you!

@pnf
Copy link
Contributor

pnf commented Dec 15, 2019

Awesome. It's really irritating that some linters fail in a manner that produces unparseable output. The invocations are wrapped in (try ... (catch ...)), but exceptions somehow get through sometimes.

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

No branches or pull requests

3 participants