This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-12
Channels
- # admin-announcements (2)
- # aleph (2)
- # arachne (16)
- # beginners (33)
- # boot (20)
- # bristol-clojurians (6)
- # capetown (4)
- # cider (50)
- # clojure (74)
- # clojure-austin (4)
- # clojure-canada (1)
- # clojure-china (2)
- # clojure-czech (1)
- # clojure-greece (1)
- # clojure-poland (4)
- # clojure-quebec (5)
- # clojure-russia (5)
- # clojure-spec (34)
- # clojure-uk (45)
- # clojurescript (131)
- # cursive (4)
- # datascript (2)
- # datomic (9)
- # editors (2)
- # emacs (2)
- # hoplon (173)
- # jobs (5)
- # lein-figwheel (3)
- # leiningen (1)
- # off-topic (1)
- # om (44)
- # onyx (8)
- # proton (10)
- # re-frame (81)
- # reagent (23)
- # untangled (57)
- # vim (2)
- # yada (8)
@biscuitpants: there's no way to achieve that. The indent styles let you specify that a certain number of arguments are supposed to get a larger indentation. However, in your case the number of arguments you want isn't fixed, and the level of indentation you want isn't fixed either. :-/
ah I see š
so the indentation only works for a set amount of args, iām guessing?
Hi, I am having a problem with refactoring code in cider. When I invoke M-x cljr-rename-symbol
then emacs freezes for ca. 20 seconds and when it becomes responsive again I can see a following message in *Messages*
buffer:
Fetching symbol occurrences...
nrepl-send-sync-request: Sync nREPL request timed out (op find-symbol prefix-rewriting true debug false ns abcd.service.transaction dir /Users/jan/Dev/evat/ file /Users/jan/Dev/evat/src/clj/abcd/service/transaction.clj line 204 column 19 name persist-transaction ignore-errors nil)
the only relevant settings for cljr
in my custom.el
(I use Prelude):
(setq cljr-warn-on-eval nil)
also in such a big project there could be some namespaces which we canāt build an AST for. so you can set cljr-ignore-analyzer-errors
to t as well
so it tells you when you have all the ASTs built. after that rename should be relatively snappy š
@benedek: I retested refactoring. My config:
(setq cljr-warn-on-eval nil)
(setq cljr-ignore-analyzer-errors nil)
(setq cljr--debug-mode t)`
*Messages*
Comments relate to logs below them:
;; T 0 min:
Connected. Jan, this could be the start of a beautiful program.
;; CPU ~100% T 1 min:
Artifact cache updated
;; CPU stays at 100%...
;; T 5 min. CPU dropped to ca. 0%:
error in process filter: user-error: Some namespaces are in a bad state: error "nil" in taxamo.test.service.settlement-global-test; error "nil" in taxamo.test.service.tax-service-globalisation-test
error in process filter: Some namespaces are in a bad state: error "nil" in taxamo.test.service.settlement-global-test; error "nil" in taxamo.test.service.tax-service-globalisation-test
Next, I tried to rename a symbol.
1. CPU grew up to 100%
2. In minibuffer I saw: Fetching symbol occurencesā¦
.
3. After ca. 20 seconds in *Messages*
I noticed the same message as before:
Fetching symbol occurrences...
nrepl-send-sync-request: Sync nREPL request timed out (op find-symbol prefix-rewriting true debug true ns taxamo.service.transaction dir /Users/jan/Dev/evat/ file /Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj line 204 column 20 name persist-transaction ignore-errors nil)
4. CPU decreased to ca. 0%hmm, this time, there was no exception but the same error in *Messages*
:
Fetching symbol occurrences...
nrepl-send-sync-request: Sync nREPL request timed out (op find-symbol prefix-rewriting true debug true ns taxamo.service.transaction dir /Users/jan/Dev/evat/ file /Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj line 160 column 9 name prepare-transaction-data ignore-errors true)
in *nrepl-messages*
:
(-->
op "info"
session "de980247-4255-4072-8115-5c7955f3c0ad"
ns "taxamo.service.transaction"
symbol "prepare-transaction-data"
id "17"
)
(<--
arglists-str "([merchant transaction-data])"
column 1
file "file:/Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj"
id "17"
line 160
name "prepare-transaction-data"
ns "taxamo.service.transaction"
session "de980247-4255-4072-8115-5c7955f3c0ad"
status ("done")
)
(-->
op "find-symbol"
prefix-rewriting "true"
debug "true"
ns "taxamo.service.transaction"
dir "/Users/jan/Dev/evat/"
file "/Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj"
line 160
column 9
name "prepare-transaction-data"
ignore-errors "true"
session "de980247-4255-4072-8115-5c7955f3c0ad"
id "18"
)
(<--
id "14"
occurrence "REMOVED"
session "de980247-4255-4072-8115-5c7955f3c0ad"
)
(<--
id "14"
occurrence "REMOVED"
session "de980247-4255-4072-8115-5c7955f3c0ad"
)
(<--
id "14"
occurrence "{:line-beg 295, :line-end 295, :col-beg 33, :col-end 77, :file \"/Users/jan/Dev/evat/src/clj/taxamo/service/transaction_upload_service.clj\", :name \"taxamo.service.transaction/prepare-transaction-data\", :match \"transaction-data (transaction-service/prepare-transaction-data merchant transaction-data)\"}"
session "de980247-4255-4072-8115-5c7955f3c0ad"
)
cider properly found occurences of the symbol (I removed that piece of log) and nothing else happened
it looks like Iāll have to spend an evening debugging cider-nrepl unless you have some other ideas š
so I see two options here:
- after jacking in you wait until you see "AST cache updatedā, on a project this large this could take a long time. but after that rename-symbol should be snappy. (if it is not, that is deffo a bug, pls report it on github)
other option needs a bit of explanation. rename symbol calls the middleware synchronously, reason being the project being in a broken state until the renaming is finished. so we want to block until all the renaming is finished. however if cljr-warn-on-eval
is nil we define 25sec timeout, see line 2102 in clj-refactor.el: (let* ((nrepl-sync-request-timeout (if cljr-warn-on-eval nil 25))
. I guess my reasoning here was that if warn-on-eval is nil we warm the ast cache so the whole thing should not take longer than 25sec. perhaps this is a wrong assumption. anyhow you can rewrite this line to be (nrepl-sync-request-timeout nil)
re-evaluate the defun
and see if that helps.