Skip to content

clojure-cider-kibit not working anymore #63

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

Open
zilti opened this issue Nov 20, 2019 · 5 comments
Open

clojure-cider-kibit not working anymore #63

zilti opened this issue Nov 20, 2019 · 5 comments

Comments

@zilti
Copy link

zilti commented Nov 20, 2019

Having the checker enabled results in this error:

Error from syntax checker clojure-cider-kibit: Done with no errors
error in process filter: Wrong number of arguments: (((form closure (t) (ns) (format "(do (require 'squiggly-clojure.core) (squiggly-clojure.core/check-kb '%s %s))" ns (flycheck-sexp-to-string (buffer-file-name)))) (ns . "cvfetcher.fetch-linkedin") (callback . #[128 "ÁÂÀ�#�" [#s(flycheck-syntax-check #<buffer fetch_linkedin.clj> clojure-cider-kibit "32" "/home/zilti/projects/crawler/src/cvfetcher/") apply flycheck-report-buffer-checker-status] 5 "

(fn &rest ARGS)"]) (checker . clojure-cider-kibit) t) (_buffer ex _rootex _sess) (funcall callback (quote errored) (format "Form %s of checker %s failed: %s" form checker ex))), 0
error in process filter: Wrong number of arguments: (((form closure (t) (ns) (format "(do (require 'squiggly-clojure.core) (squiggly-clojure.core/check-kb '%s %s))" ns (flycheck-sexp-to-string (buffer-file-name)))) (ns . "cvfetcher.fetch-linkedin") (callback . #[128 "ÁÂÀ�#�" [#s(flycheck-syntax-check #<buffer fetch_linkedin.clj> clojure-cider-kibit "32" "/home/zilti/projects/crawler/src/cvfetcher/") apply flycheck-report-buffer-checker-status] 5 "

(fn &rest ARGS)"]) (checker . clojure-cider-kibit) t) (_buffer ex _rootex _sess) (funcall callback (quote errored) (format "Form %s of checker %s failed: %s" form checker ex))), 0
@pnf
Copy link
Contributor

pnf commented Nov 28, 2019

When trying to reproduce this in the sample project, I initially got the error because acyclic/squiggly-clojure had not been properly injected during cider-jack-in. This happened
because flycheck-clojure-setup was run before cider itself initialized, and cider-jack-in-dependencies was reset. Once I resolved this problem, the sample core.clj checked with all three linters.
The problem was harder to diagnose than expected, because cider no longer logs to *nrepl-messages... unless you explicitly (setq nrepl-log-messages t), so the FileNotFound exceptions due to missing dependencies was hidden. I've modified the troubleshooting instructions in the README accordingly.
Of course your problem might be different, but the contents of *nrepl-messages... will still be critical to debugging it. Let me know what, if any, errors you see in this buffer.

@zilti
Copy link
Author

zilti commented Nov 29, 2019

Okay, I've called cider-jack-in in a fairly barebones project with deps.edn, and afterwards called flycheck-clojure-setup. I still get the "Error: done with no errors" problem. Here's the contents of the nrepl-messages buffer:

(-->
  id         "1"
  op         "clone"
  time-stamp "2019-11-29 10:47:45.789252171"
)
(<--
  id          "1"
  session     "7f73c9e8-219a-481d-8fec-1e738dcdc381"
  time-stamp  "2019-11-29 10:47:45.833074506"
  new-session "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  status      ("done")
)
(-->
  id         "2"
  op         "clone"
  time-stamp "2019-11-29 10:47:45.843787482"
)
(<--
  id          "2"
  session     "5240334b-72df-4fb3-bae8-a9291ea7d890"
  time-stamp  "2019-11-29 10:47:45.847905651"
  new-session "c4e60ee5-7692-451e-ba30-153df62589de"
  status      ("done")
)
(-->
  id         "3"
  op         "describe"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:45.864446692"
)
(<--
  id         "3"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:45.882930249"
  aux        (dict ...)
  ops        (dict ...)
  status     ("done")
  versions   (dict ...)
)
(-->
  id                             "4"
  op                             "eval"
  session                        "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp                     "2019-11-29 10:47:45.926316630"
  code                           "(clojure.core/apply clojure.core/require clojure.main/repl-r..."
  column                         1
  content-type                   "true"
  file                           "*cider-repl projects/crawler-linkedin:localhost:41931(clj)*"
  inhibit-cider-middleware       "true"
  line                           47
  nrepl.middleware.print/options (dict ...)
  nrepl.middleware.print/print   "cider.nrepl.pprint/pprint"
  nrepl.middleware.print/quota   1048576
  nrepl.middleware.print/stream? "1"
)
(<--
  id         "4"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:46.186008888"
  value      "nil"
)
(<--
  id         "4"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:46.226537494"
  ns         "user"
)
(<--
  id         "4"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:46.226787096"
  status     ("done")
)
(-->
  id         "5"
  op         "out-subscribe"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:46.227284240"
)
(-->
  id                             "6"
  op                             "init-debugger"
  session                        "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp                     "2019-11-29 10:47:46.327940104"
  nrepl.middleware.print/options (dict ...)
  nrepl.middleware.print/print   "cider.nrepl.pprint/pprint"
  nrepl.middleware.print/quota   1048576
  nrepl.middleware.print/stream? "1"
)
(-->
  id               "7"
  op               "version"
  session          "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp       "2019-11-29 10:47:46.331803357"
  debug            "false"
  prefix-rewriting "false"
)
(<--
  id         "7"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:46.545340453"
  status     ("done")
  version    "2.5.0-SNAPSHOT"
)
(<--
  id            "5"
  session       "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp    "2019-11-29 10:47:46.548327093"
  out-subscribe "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  status        ("done")
)
(-->
  id               "8"
  op               "version"
  session          "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp       "2019-11-29 10:47:46.569094644"
  debug            "false"
  prefix-rewriting "false"
)
(<--
  id         "8"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:46.578596721"
  status     ("done")
  version    "2.5.0-SNAPSHOT"
)
(-->
  id               "9"
  op               "artifact-list"
  session          "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp       "2019-11-29 10:47:46.591702711"
  debug            "false"
  force            "true"
  prefix-rewriting "false"
)
(<--
  id         "9"
  session    "c6fd7249-caba-4c4d-b154-7eedc3e366de"
  time-stamp "2019-11-29 10:47:52.497916794"
  artifacts  ("_7696122/clojure-poloniex" ...)
  status     ("done")
)
(-->
  id         "10"
  op         "eval"
  session    "c4e60ee5-7692-451e-ba30-153df62589de"
  time-stamp "2019-11-29 10:49:09.966413328"
  code       "(do (require 'squiggly-clojure.core) (squiggly-clojure.core/..."
)
(<--
  id         "10"
  session    "c4e60ee5-7692-451e-ba30-153df62589de"
  time-stamp "2019-11-29 10:49:12.009842443"
  err        "Execution error (FileNotFoundException) at user/eval12334 (R..."
)
(<--
  id         "10"
  session    "c4e60ee5-7692-451e-ba30-153df62589de"
  time-stamp "2019-11-29 10:49:12.020161723"
  ex         "class java.io.FileNotFoundException"
  root-ex    "class java.io.FileNotFoundException"
  status     ("eval-error")
)
(<--
  id         "10"
  session    "c4e60ee5-7692-451e-ba30-153df62589de"
  time-stamp "2019-11-29 10:49:12.219914353"
  status     ("done")
)
(<--
  id                 "10"
  session            "c4e60ee5-7692-451e-ba30-153df62589de"
  time-stamp         "2019-11-29 10:49:12.337022018"
  changed-namespaces (dict ...)
  repl-type          "clj"
  status             ("state")
)

@pnf
Copy link
Contributor

pnf commented Nov 29, 2019 via email

@zilti
Copy link
Author

zilti commented Nov 29, 2019

Yes, correct, it was not in there... The way I did it now was like this:

  1. cider-jack-in
  2. flycheck-clojure-setup
  3. cider-quit
  4. cider-jack-in

@pnf
Copy link
Contributor

pnf commented Nov 29, 2019

To get proper lazy loading, without having cider re-initializing cider-jack-in-dependencies, the following use-package setup seems to work. I don't need to do anything other than cider-jack-in.

(use-package cider
  :ensure t :defer t
  :config
  (setq
    cider-repl-history-file ".cider-repl-history"  ;; not squiggly-related, but I like it
	nrepl-log-messages t)                  ;; not necessary, but useful for trouble-shooting
  (flycheck-clojure-setup))                   ;; run setup *after* cider load but before cider-jack-in runs

(use-package flycheck-clojure
  :defer t
  :commands (flycheck-clojure-setup)               ;; autoload
  :config
  (eval-after-load 'flycheck
    '(setq flycheck-display-errors-function #'flycheck-pos-tip-error-messages))
  (add-hook 'after-init-hook #'global-flycheck-mode))

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

2 participants