calva icon indicating copy to clipboard operation
calva copied to clipboard

Jump to files are read-only

Open tggreene opened this issue 1 year ago • 2 comments

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.

tggreene avatar May 07 '24 15:05 tggreene

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“.

PEZ avatar May 07 '24 16:05 PEZ

Brilliant, thanks Peter

tggreene avatar May 08 '24 10:05 tggreene