Fork me on GitHub
#cursive
<
2020-11-21
>
ikitommi09:11:30

is there an easy way to edit a file inside a dependency (jar)? With emacs, you can make a buffer editable - modify the contents and reload that file into a repl: you can basically live-edit you dependencies, which is really awesome. With IDEA, can’t make the buffer/view editable. Could copy the content somewhere else and edit there, but looking for a cleaner way for this.

ikitommi09:11:02

not looking for any permanent changes, just ability to change what the current repl sees.

imre10:11:45

This would be awesome. I do remember seeing an idea command to make a file editable, not sure if it helps here

cfleming10:11:53

There isn’t, but this is something a few people have asked for. One idea I had was an action to convert a file from a jar into a scratch file, which you could then edit and send to the REPL.

👍 3
ikitommi10:11:06

that would be great. Two big benefits: • ability to use things like #p (hashp) or tap> (with portal / reveal) from 3rd party libs • ability to try / fix small things in libs. currently working with a lot of alpha libs (many ours), which are great, but full of gaps that would be to add/fix locally in the calling project as you find them. git-sha-deps-flow simplifies things a lot, but this would allow fixes to be instant.

cfleming11:11:36

Ok, I’ll check in the JetBrains slack how best to achieve that.

1
sogaiu02:11:23

possibly not so helpful here, but fwiw i have some clojure code in: https://github.com/sogaiu/alc.index-defs that extracts .clj* files from dependency jars and makes them avaiable under a .alc-id subdirectory of one's project.

holyjak10:11:48

FYI What I do is switch the repl to the ns of the file, copy-paste the fn to that file, adjust, eval. But ☝️ would be much more comfortable

mike_ananev17:11:17

brew install mc
mc
Just run Midnight Commander, put cursor on jar file and hit Enter. Use F4 to edit. Like in old good days..

cfleming20:11:20

What’s been implemented is copying to a scratch file, as described in that issue:

nice 1
cfleming20:11:49

Scratch files are still a bit funky, but it seems to work pretty well.

❤️ 2