This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-23
Channels
- # babashka (68)
- # beginners (133)
- # calva (5)
- # chlorine-clover (21)
- # cider (40)
- # clj-kondo (42)
- # cljs-dev (31)
- # clojure (53)
- # clojure-austin (1)
- # clojure-europe (30)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-uk (104)
- # clojurescript (15)
- # datascript (2)
- # datomic (50)
- # emacs (12)
- # fulcro (82)
- # graalvm (4)
- # hoplon (225)
- # jobs (4)
- # jobs-discuss (7)
- # joker (5)
- # juxt (17)
- # kaocha (13)
- # leiningen (16)
- # meander (21)
- # nrepl (18)
- # off-topic (16)
- # pathom (8)
- # pedestal (13)
- # perun (1)
- # re-frame (4)
- # spacemacs (23)
- # testing (28)
- # unrepl (3)
- # vim (5)
- # xtdb (1)
hello, I'm trying to use refactor on my jacked-in project with shadow-cljs but it keeps saying
user-error: The refactor-nrepl middleware isn't available! Did you remember to install it?
maybe I'm inside a cljs repl which doesn't have it in it's classpath?
my commands are jack in (shadow/watch :main) then (shadow/repl :main)
you can add the line :nrepl {:middleware [refactor-nrepl.middleware/wrap-refactor]}
in shadow-cljs.edn config file.
More info about: https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL
you can add the line :nrepl {:middleware [refactor-nrepl.middleware/wrap-refactor]}
in shadow-cljs.edn config file.
More info about: https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL
@vinnyataide I guess you can also remove clj-refactor.el
if you don’t need it.
no, pure emacs @bozhidar
I've just removed it I don't know why it was installed
What can I do about error in process filter: Sync nREPL request timed out (op eval code (require 'shadow.cljs.devtools.api) enlighten true)
?
It also opens two REPL buffers, with exactly the same names, on the same port. One with ClojureScript REPL init form, one without. Both claim to be ClojureScript REPLs.
cljs uses /usr/bin/clojure -A:dev -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.2"} cider/cider-nrepl {:mvn/version "0.24.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'
Is it possible for cider-browse-spec
to follow aliased specs? e.g., with ::some-alias/foo
at point, show the spec for :the.fully.qualified.spec/foo
?
I have a hack around this on my local branch of Cider, by macroexpanding namespace-aliased symbols in cider-symbol-at-point
:
(defun cider-symbol-at-point (&optional look-back)
"Return the name of the symbol at point, otherwise nil.
Ignores the REPL prompt. If LOOK-BACK is non-nil, move backwards trying to
find a symbol if there isn't one at point."
(or (when-let* ((str (thing-at-point 'symbol)))
;; resolve ns-aliased keywords
(when (string-match-p "^::.+" str)
(setq str (or (ignore-errors (cider-sync-request:macroexpand "macroexpand-1" str)) "")))
(unless (text-property-any 0 (length str) 'field 'cider-repl-prompt str)
;; Remove font-locking and trailing . from constructors like Record.
(string-remove-suffix "." (substring-no-properties str))))
(when look-back
(save-excursion
(ignore-errors
(when (looking-at "(")
(forward-char 1))
(while (not (looking-at "\\sw\\|\\s_\\|\\`"))
(forward-sexp -1)))
(cider-symbol-at-point)))))
Huh, that's the first time I came across that command.. and it makes so many faulty assumptions
(ns foo
(:require [clojure.spec.alpha :as s]))
(s/def :thing/id string?)
eg. something like this doesn't workAnd why does the prompt offer me "shadow" and "shadow-select" when starting a REPL with deps.edn when that is not working anyway
Well, it seems to not be possible to set a separate "preferred build tool" for CLJ and CLJS
I’ve decided a long time ago that this a bit excessive as most build tools are not specific to Clojure/ClojureScript, that’s why there’s just one build tool config. I think that shadow-cljs is probably the only one that defies this. It’s easy to configure the build tool on a project basis, which I think covers the use-case of most people pretty well.
Oh and it looks like shadow-cljs can also handle the clj repl, not just the cljs one. So I can just set the preferred build tool to shadow-cljs. Though I currently fail to do that in .dir-locals.el
...
((nil . ((cider-preferred-build-tool . 'shadow-cljs))))
at least gives me an error.I have a hack around this on my local branch of Cider, by macroexpanding namespace-aliased symbols in cider-symbol-at-point
:
(defun cider-symbol-at-point (&optional look-back)
"Return the name of the symbol at point, otherwise nil.
Ignores the REPL prompt. If LOOK-BACK is non-nil, move backwards trying to
find a symbol if there isn't one at point."
(or (when-let* ((str (thing-at-point 'symbol)))
;; resolve ns-aliased keywords
(when (string-match-p "^::.+" str)
(setq str (or (ignore-errors (cider-sync-request:macroexpand "macroexpand-1" str)) "")))
(unless (text-property-any 0 (length str) 'field 'cider-repl-prompt str)
;; Remove font-locking and trailing . from constructors like Record.
(string-remove-suffix "." (substring-no-properties str))))
(when look-back
(save-excursion
(ignore-errors
(when (looking-at "(")
(forward-char 1))
(while (not (looking-at "\\sw\\|\\s_\\|\\`"))
(forward-sexp -1)))
(cider-symbol-at-point)))))