This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-23
Channels
- # beginners (20)
- # boot (7)
- # cider (115)
- # cljsrn (13)
- # clojars (1)
- # clojure (122)
- # clojure-italy (23)
- # clojure-spec (60)
- # clojurescript (74)
- # data-science (7)
- # datomic (26)
- # emacs (8)
- # graphql (1)
- # lumo (26)
- # music (1)
- # off-topic (1)
- # re-frame (9)
- # ring (3)
- # rum (1)
- # spacemacs (4)
- # uncomplicate (6)
- # vim (7)
@richiardiandrea It might be. I alread filed a question: https://github.com/boot-clj/boot/issues/632 - no answers yet. I'm starting to wonder if I'm the only one using boot and spacemacs who wants to rename symbols 🙂.
@kurt-o-sys still good to solve that problem 😀
🙂 Not sure yet how exactly to make it work. I do get why it's not working, but that's not good enough 🙂
Will try to look into it as well at some point 😀
thx. It'll be ok one day, I guess 😛
Well, not really - it is related, but not the same. The fix in https://github.com/clojure-emacs/refactor-nrepl/issues/97#issuecomment-121038439 don't solve the issue I have with renaming symbols (not the same as renaming files).
but it's true that the problem is that refactoring seems to use cache-files of boot.
@benedek the 10point review is actually another problem... There's a 7 point review to reproduce the replace symbol:
1. start a new boot project
2. position yourself on the println
in core.clj
3. SPC m r e f
(refactor - extract - function) and give it a name
4. see (println...
extracted in a new function
5. position yourself on the new function
6. SPC m r r s
(refactor - rename - symbol) and give it a name
7. see renaming performed on the cached file, not on the project file
this sounds to me like the original problem i quoted. eg no way for boot to track back orig file location
right... so, you're saying it can't (or won't?) be solved?
I mean: renaming files/dirs does work. renaming symbols doesn't. The issue may be related, but is not the same. If it can't work, it's fine, but it'd be nice to know it can't work (so I can stop trying).
sorry. I am just trying to make sense of it before having a proper look and perhaps do a PR for boot
right. That makes perfect sense... well, about the problem, I only know that it is because refactoring symbols seems to be working on boot cached files, probably because of these lines (although I'm not sure): https://github.com/clojure-emacs/refactor-nrepl/blob/992e9a25bdb411bc49c5c38a48ff0182d91631f2/src/refactor_nrepl/find/find_symbol.clj#L138 , having (core/dirs-on-classpath)
this probably pointing to the cache-files, not the actual project files. It's a guess, but I'm not really sure about it.
ok... thx for the info. - it was a bit confusing, since renaming a file or dir seems to work, and the title doesn't seem to adddress renaming symbols (which doesn't work).
@benedek this is the trick I came up with for cider-nrepl https://github.com/clojure-emacs/cider-nrepl/pull/422 If there's a better way to go from temp file → real file it would be useful to replace my code doing that.
I'm not certain, there might be something in the cache which allows us to figure out the origin
I mean, I suppose the proper thing to do would be to semantically strip the ~/.boot/cache/home/…
relative to the cwd of the jvm or something like that
based on the discussions around this i am not sure that is the case. acc to dearen one could use
boot.user=> (into (get-env :source-paths) (get-env :resource-paths))
#{"src" "resources"}
Not sure how this would help? I mean, :source-paths
and resource-paths
are set... Well, let me try first 🙂
https://github.com/clojure-emacs/refactor-nrepl/commit/59c377fad9fcfc30cf9d7a2c0064dfb69624bf21
new snapshot is on clojars, give it a spin @kurt-o-sys pls
@benedek no errors, that's ok, but still saving to the boot cache files, not the project files.
oh wait... not sure if it's the right refactor-nrepl
well... I thought I was. This is my .boot/profile.boot
:
(deftask cider "CIDER profile"
[]
(require 'boot.repl)
(swap! @(resolve 'boot.repl/*default-dependencies*)
concat '[[org.clojure/tools.nrepl "0.2.12"]
[cider/cider-nrepl "0.15.0"]
[refactor-nrepl "2.4.0-SNAPSHOT"]])
(swap! @(resolve 'boot.repl/*default-middleware*)
concat '[cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor])
identity)
cider jack-in
SPC m s i
oh, wrong one...
oh damn'd.
I followed this https://github.com/boot-clj/boot/wiki/Cider-REPL#a-better-way - but apparently, I did something wrong 😛
@kurt-o-sys it's a bit confusing. cider-jack-in basically generates the cli by itself (and doesn't know about the cider task) the boot wiki is aimed at cli users really
ok... so, I can remove profile.boot
and it should work?
Whenever I (require 'my-namespace)
at the REPL, I get a spurious error message… even though I can perfectly well use my-namespace/functions-defined-there
.
As suggested at https://groups.google.com/forum/#!topic/clojure/qSiGeQZzyT0, if I use cljs.core/require
instead of require
, it works.
But unfortunately that means I can’t evaluate a namespace declaration that depends on one of my other namespaces, because it gives me a big stack trace (since it uses regular require
).
@dominicm Things seem to be more complicated. When I do SPC m s i
(cider jack-in, apparently)
Starting nREPL server via /usr/local/bin/boot -i "(require 'cider.tasks)" -d org.clojure/tools.nrepl\:0.2.12 -d refactor-nrepl\:2.3.0-SNAPSHOT -d cider/cider-nrepl\:0.15.0-SNAPSHOT cider.tasks/add-middleware -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware cider repl -s wait...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0-alpha17 already loaded, NOT loading version 1.2.0
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
java.util.concurrent.FutureTask.run FutureTask.java: 266
...
clojure.core/binding-conveyor-fn/fn core.clj: 2027
boot.core/boot/fn core.clj: 1030
...
boot.core/construct-tasks core.clj: 984
java.lang.IllegalArgumentException: No such task (cider)
clojure.lang.ExceptionInfo: No such task (cider)
file: "/tmp/boot.user8420735862008947390.clj"
line: 31
error in process sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0-alpha17 already loaded, NOT loading version 1.2.0
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
java.util.concurrent.FutureTask.run FutureTask.java: 266
...
clojure.core/binding-conveyor-fn/fn core.clj: 2027
boot.core/boot/fn core.clj: 1030
...
boot.core/construct-tasks core.clj: 984
java.lang.IllegalArgumentException: No such task (cider)
clojure.lang.ExceptionInfo: No such task (cider)
file: "/tmp/boot.user8420735862008947390.clj"
line: 31
This issue has apparently been reported at https://dev.clojure.org/jira/browse/CLJS-1473, and probably has something to do with the namespace being created during my CIDER session, rather than coming purely from disk.
(Also reported at https://github.com/clojure-emacs/cider/issues/2028, apparently.)
@kurt-o-sys you might need a boot.properties 🙂 boot -V > boot.properties
and then update the clojure version to the one you want
same.
inside my project folder:
$ cat boot.properties
#
#Sun Jul 23 20:52:20 CEST 2017
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=RELEASE
BOOT_VERSION=2.7.1
it seems boot is looking for a task cider
(the one I deleted in profile.boot
)
ok, got it: https://github.com/boot-clj/boot/wiki/Cider-REPL#a-better-way - step 2. This apparently changes some things...
so now... how to set the version of nrepl-refactor
?
now I seem to be using 2.3.0-SNAPSHOT
?
using the emacs-lisp
layer in spacemacs...
ELISP> (emacs-version)
"GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)\n of 2016-04-17 on lgw01-04, modified by Debian"
this?clj-refactor 2.3.0-SNAPSHOT (...) refactor-nrepl 2.3.0-SNAPSHOT
- the wrong ones. How to make it us the right one? (The command above shows only the version)
yeah, I do... I thought I mentioned that 😛. I may be wrong...
tbh not sure about spacemacs specific way to upgrade but I would M-x package-install-package
right, well, the same way. That's how I did it.
oh, wait, sec.
damn'd. OK, let me look for that one
I think clj-refactor.el
is installed... (repl works etc, but with the wrong version)
ok, I guess I may be spamming the spacemacs channel in a few minutes 😛
well, spacemacs is emacs with some standard config etc, as far as I understand... anyway, I'm updating a bunch of packages now. I'll be back in a few minutes 😛
thx a lot. I suppose I'll get there today 🙂
Extracting clj-refactor-20170720.712/
Extracting clj-refactor-20170720.712/CHANGELOG.md
Wrote $HOME/.emacs.d/elpa/clj-refactor-20170720.712/CHANGELOG.md
Extracting clj-refactor-20170720.712/clj-refactor-pkg.el
Wrote $HOME/.emacs.d/elpa/clj-refactor-20170720.712/clj-refactor-pkg.el
Extracting clj-refactor-20170720.712/clj-refactor.el
Wrote $HOME/.emacs.d/elpa/clj-refactor-20170720.712/clj-refactor.el
doesn't look really bad, does it? (or should it be another version... well, let me try first)nice. Works, cool. Thanks a lot!
It's a bit confusing, the jack-in
, connect
, ... and boot repl
, cider repl
etc. But it works, thanks a lot!
@benedek the fix you came up with, was it already present, or did you add it? Struggling to follow along with what happened. Want to backport it into cider either way 🙂
Oh, I couldn't. I remember now. The problem was that I had a full path to a temp file, instead of a relative one.
@kurt-o-sys cool. happy hacking!
thx! nice.
https://github.com/clojure-emacs/refactor-nrepl/commit/59c377fad9fcfc30cf9d7a2c0064dfb69624bf21