BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.71k stars 219 forks source link

Jump to files are read-only #2550

Open tggreene opened 6 months ago

tggreene commented 6 months ago

When I jump to a function definition from a third party library the file is opened in read-only mode. For example when I jump to the ring.middleware.gzip/wrap-gzip function by holding alt and clicking on it it opens up the gzip.clj file correctly but as a read-only buffer.

Ideally I'd like to be able to edit these files to insert debugging statements but can't find any way of doing it, something I was used to doing in emacs.

It may well not be calva that's doing this, if so I'll close this issue.

PEZ commented 6 months ago

Hi! Thanks for bringing this up. We should document this, so please don't close the issue.

It is VS Code that doesn't suport editing files from readonly sources. What you can do is copy the forms you want to edit to the REPL Window and edit them from there. There are commands for conveniently sending a function definition or something else to the REPL Window.

image

The commands will also switch the current ns for the REPL Window to that of from where you sent the forms, so evaluating them will be as if editing the original “file“.

tggreene commented 6 months ago

Brilliant, thanks Peter