This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-12
Channels
- # aleph (3)
- # announcements (7)
- # babashka (22)
- # beginners (44)
- # calva (19)
- # chlorine-clover (1)
- # cider (20)
- # clj-kondo (55)
- # clojure (100)
- # clojure-austin (9)
- # clojure-europe (19)
- # clojure-italy (19)
- # clojure-nl (13)
- # clojure-portugal (2)
- # clojure-uk (7)
- # clojurescript (38)
- # community-development (3)
- # conjure (2)
- # cryogen (57)
- # cursive (6)
- # datalog (3)
- # datomic (24)
- # emacs (17)
- # exercism (8)
- # fulcro (3)
- # holy-lambda (8)
- # jobs (6)
- # jobs-discuss (9)
- # joker (3)
- # lambdaisland (5)
- # leiningen (5)
- # music (9)
- # nextjournal (1)
- # nrepl (2)
- # off-topic (9)
- # other-languages (4)
- # pathom (6)
- # polylith (23)
- # re-frame (5)
- # reagent (5)
- # remote-jobs (1)
- # reveal (1)
- # shadow-cljs (3)
- # tools-build (1)
- # tools-deps (3)
- # xtdb (2)
Hi, any idea on what might cause an error:
Error running hook "clj-refactor-mode" because: (error Given parent class xref-location is not a class)
When opening a .clj file.
More specific stacktrace points that this comes from cider
:
Debugger entered--Lisp error: (error "Given parent class xref-location is not a class")
error("Given parent class %S is not a class" xref-location)
eieio-defclass-internal(xref-etags-location (xref-location) ((tag-info :type list :initarg :tag-info) (file :type string :initarg :file :reader xref-location-group)) (:documentation "Location of an etags tag."))
...
require(etags)
...
require(cider-common)
...
require(cider-client)
...
require(cider)
...
clj-refactor-mode()
...
Allright, recompiled everything and now I'm getting:
Symbol's value as variable is void: xref-etags-location
Not really familiar with this stuff but either a require
is missing or xref-etags-location
does in fact not exist anymore?
Sadly breaking changes aren't uncommon in .el libs 😞
Ok figured it out. I need to investigate a bit more but I'll write here a thorough explanation soon.
Ok, cider-common.el
requires etags
here: https://github.com/clojure-emacs/cider/blob/master/cider-common.el#L31
That's required only for function find-tag-marker-ring
(https://github.com/clojure-emacs/cider/blob/master/cider-common.el#L154). That's obsolete since emacs 25.1
, but I think finally emacs 28 removed it completely.
The correct way should be, to my knowledge, to first (require 'xref)
and then use xref-push-marker-stack
instead of find-tag-marker-ring
.
Here's a similar issue in haskell-mode: https://github.com/haskell/haskell-mode/issues/459
Yep, writing one.
I patched my own cider with those changes and things seem to work.
I wrote a PR fixing this: https://github.com/clojure-emacs/cider/pull/3073
✅ it lgtm but that's not my area of expertise either. Let's see if a reviewer pops up else feel free to bump the thread over gh.
Not my area of expertise either 😉
However, the code is essentially identical:
• find-tag-marker-ring
was a variable alias for xref--marker-ring
• xref-push-marker-stack
is implemented as:
(defun xref-push-marker-stack (&optional m)
"Add point M (defaults to `point-marker') to the marker stack."
(ring-insert xref--marker-ring (or m (point-marker))))
• That's identical with the old code in cider-common
(minus the optional m param)does cljs-repl-type 'shadow
actually work for people? I don't remember it ever working, and have always had a custom setup for it. This is what I get:
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :main) (shadow/nrepl-select :main))
;;
Execution error (ExceptionInfo) at shadow.cljs.devtools.server.runtime/get-instance! (runtime.clj:11).
shadow-cljs has not been started yet!
In embedded mode you need to call (shadow.cljs.devtools.server/start!) to start it.
If you have a shadow-cljs server or watch running then you are not connected to that process.
it also seems there's no built-in support for adding the shadow-cljs middleware? I feel like a jack-in-clj&cljs
should just work at this point but it seems some key pieces are missing...
you are saying it is supposed to work? because I don't find any mention in the cider code base of the shadow middleware
Got it to work by adding this:
(add-to-list 'cider-jack-in-nrepl-middlewares (list "shadow.cljs.devtools.server.nrepl/middleware"
:predicate #'cider--shadow-cljs-repl-p))
(defun cider--shadow-cljs-repl-p (_spec)
(eq 'shadow cider-default-cljs-repl))
and adding a call to (shadow.cljs.devtools.server/start!)
to the cljs repl init code. It seems the current code assumes that when cljs-repl-type
is shadow, that your cider-preferred-build-tool
is also shadow