This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-06
Channels
- # babashka (19)
- # beginners (68)
- # calva (9)
- # cider (27)
- # clj-kondo (64)
- # clj-on-windows (2)
- # cljdoc (8)
- # clojure (11)
- # clojure-europe (58)
- # clojure-italy (1)
- # clojure-nl (23)
- # clojure-uk (5)
- # clojurescript (9)
- # cryogen (18)
- # cursive (14)
- # data-science (17)
- # emacs (6)
- # gorilla (6)
- # graphql (1)
- # gratitude (2)
- # holy-lambda (10)
- # introduce-yourself (1)
- # jackdaw (3)
- # jobs (1)
- # leiningen (2)
- # malli (3)
- # missionary (33)
- # off-topic (21)
- # pedestal (7)
- # polylith (8)
- # quil (3)
- # random (1)
- # releases (1)
- # remote-jobs (7)
- # shadow-cljs (18)
- # specter (1)
- # sql (8)
Anyone getting: > nrepl-send-sync-request: Sync nREPL request timed out (op macroexpand expander macroexpand-1 code ... After upgrading to latest Cider?
Resolution was to use cider-nrepl latest (0.27.2), it fixes this and other nasty issues related to *out*
handling
Resolution was to use cider-nrepl latest (0.27.2), it fixes this and other nasty issues related to *out*
handling
Hello,
I set up Emacs and Cider on a new computer and I can't figure how to activate the feature that when typing a short version of a namespace that has been already declared in another file (example [myproject.utils :as utils]
), the require entry is automatically added to the ns form.
I looked into the clojure refactor options, found an entry for common namespaces (like io
) but not for namespaces specific to the project.
Thanks
The answer has two parts :)
For well-known aliases such as io
, the list is static and the feature is controlled by these two variables:
https://github.com/clojure-emacs/clj-refactor.el/blob/9e1f92033449a4abc6218ce31670d89e3e6a4dc5/clj-refactor.el#L67-L91
Personally I expand cljr-magic-require-namespaces
with a few more entries of my liking
Now, for dynamic alias completion depending on a specific project's used aliases, the feature is called cljr-slash
. As the name suggests, it's good to bind it to the /
keyboard shortcut if it's not already
Thanks for the info.
The cljr-slash
doesn't seem to work on my fresh Spacemacs install. When I type a short version of a namespace and the M-x cljr-slash
, the slash is added but the namespace is not added to the ns form, while it is on my older Emacs installation (on my laptop).
What does this return in a clojure repl? (@(requiring-resolve 'refactor-nrepl.ns.libspecs/namespace-aliases))
{:clj
{sh (clojure.java.shell),
t (tick.core clojure.test),
x (net.cgrand.xforms),
set (clojure.set),
d (datomic.api)
... (namespaces from my project and more)
},
:cljs
{x (net.cgrand.xforms),
set (clojure.set),
p (promesa.core),
... (namespaces from my project and more)
}}
So the 'backend' looks good
Most likely the 'frontend' has an issue. Here is the list of recent commits https://github.com/clojure-emacs/clj-refactor.el/commits/master , you'll note there are a couple ones touching clj-slash
Personally I'm maintaining the backend, but run a forked version of clj-refactor.el so my knowledge doesn't apply directly there.
I would check if this condition successfully returns a truthy value:
https://github.com/clojure-emacs/clj-refactor.el/blob/9e1f92033449a4abc6218ce31670d89e3e6a4dc5/clj-refactor.el#L2018-L2027
i.e., place the cursor right after a slash, press M-: (per https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html), and paste that (and ...
sexpr. What does it return for you?
I did C-x C-e
after the and
parenthesis (to eval inline).
It indeed returns an error :
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
substring(nil 0 0)
replace-regexp-in-string("\n" " " nil)
cljr--keywordp(nil)
cljr--in-keyword-sans-alias-p()
...
so it seems easy at this point, is it for you? cljr--in-keyword-sans-alias-p
appears to be the culprit, surely you can make it "nil-safe".
I'd guess (cider-symbol-at-point)
returning nil?
I have to log off. My suggestion would be to replace (cider-symbol-at-point)
with (thing-at-point 'symbol)
, re-eval the surrounding defun and see if that works.
Regardless of the outcome, feel free to share the problem / your findings over a GH issue. Most likely we'll commit a fix that would be made available very quickly.
Hello @U45T93RA6
I also had to log off yesterday night.
I tried (cider-symbol-at-point)
and it seems to work well. It returns the symbol at point surrounded with quotes:
student|
;; M-: (cider-symbol-at-point)
returns
"student"
(cljr--in-keyword-sans-alias-p)
returns nil
Arff, I updated the packages since I saw that there was a new version of clj-refactor and now helm is broken
Error (use-package): helm/:config: Invalid read syntax: ")"
I'll use my .emacs.d
from my laptop meanwhile and check later if the clj-refactor bug is still there.Arff again. The version of Emacs is not the same so Spacemacs reinstalls all the packages at their latest version. 😞
Hi all. I'm getting this error Error: Does anyone know about this error? (nrepl-connected-hook): Error running hook "cider--connected-handler" because: (cl-no-applicable-method map-into ((right-margin 80)) hash-table)