Fork me on GitHub
#cider
<
2017-07-22
>
richiardiandrea08:07:30

@kurt-o-sys tried once and it used to work... haven't tried recently

richiardiandrea08:07:14

@bozhidar Congrats for the release! Loads of cool stuff in there

kurt-o-sys08:07:38

@richiardiandrea well, good to know it can work 🙂. I'm just wondering why it's not 'commiting' the changes, but keeping it in cache. Any ideas how to debug this?

richiardiandrea08:07:36

@kurt-o-sys not sure, I would check first of all if the buffer that cider opens is associated with project files or .boot/cache files. Then whether there is a mechanisms to support resolution from one to the other.

kurt-o-sys08:07:03

the buffers opened are the project files...

richiardiandrea08:07:39

Ok then it is weird that clj-refactor even knows about .boot/cache files

kurt-o-sys08:07:42

a new (cache) buffer, of the file I'm working in, opens when I refactor

kurt-o-sys08:07:37

It states that x files are changed, it is true: the x cached files do change, but they are not open in the buffer (except the newly opened cache of the one I'm working in)

richiardiandrea09:07:41

Uhm seems like there is some sort of resolution going on there I would report it as a bug to maybe clj-refactor first

dominicm09:07:41

@kurt-o-sys I think some commands have a known bug with this. To explain why @richiardiandrea, the files are searched for on the classpath.

dominicm09:07:38

This is a possible fix (not having looked into it properly): https://github.com/clojure-emacs/cider-nrepl/pull/422

kurt-o-sys18:07:18

Right, I saw issue #97, but that does seem to be something else. I checked #422 - it seems to be cljs related. The fix is merged and added to the latest CIDER-nrepl (0.15.0). Using the latest version doesn't solve the problem. It may be related, but it doesn't fix the problem I described (refactor - rename symbol). I don't know if it's related, but here's another issue I have: 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 symbol 6. SPC m r i s (refactor - inline - symbol) 7. see a NPE be thrown <- *first issue* (this is different than the case I described before about 'refactor - rename') 8. undo your changes 9. repeat 2 and 3 10. see extracting not working anymore <- *second issue* (restarting the repl and refactoring works again)

kurt-o-sys19:07:28

Question: is it possible to 'boot/commit' the files from spacemacs/emacs/...? I mean, if I refactor and the only thing I need to do to 'save' the changes is another command, that's no problem at all.

dominicm19:07:40

@kurt-o-sys the change in cider wouldn't fix the bug in refactor

kurt-o-sys19:07:03

nope... well, not in my case. Pretty easy to reproduce: 1. start a new boot project 2. refactor - rename Renaming is done on the cached file.

dominicm19:07:15

Sorry, wouldn't fix it.

dominicm19:07:42

I'd take a look through how rename symbol locates the location of the symbol.

dominicm19:07:06

It'll be in the refactor-nrepl repo

kurt-o-sys19:07:37

ok, thx... I have no idea, but I might take a look as well 😛

dominicm20:07:58

find-symbol operation is used to locate all uses

kurt-o-sys20:07:06

right... although the file to search in is already set there.

kurt-o-sys20:07:14

(core/dirs-on-classpath) inside find-global-symbol?

kurt-o-sys20:07:11

the cp the 'root' of a boot app is inside the cache-dir?

kurt-o-sys20:07:18

(just guessing)

kurt-o-sys20:07:59

(->> (core/dirs-on-classpath)
         (mapcat (partial core/find-in-dir (some-fn core/clj-file? core/cljc-file?)))
         (mapcat (partial find-symbol-in-file fully-qualified-name ignore-errors)))
This defines which files are searched, I guess?

richiardiandrea20:07:29

The fact is that boot resolution is not bidirectional (AFAIK) so you cannot go back from a file in the cache to a file in the project dir. I don't know because I haven't had time to check if this is the actual problem though and if not I apologise. If it is, probably this is worth a feature request in boot