Fork me on GitHub
#calva
<
2023-11-29
>
mmer12:11:21

Does Calva have any refactoring tools for things like changing the name of an alias in a namespace definition

pez12:11:03

Yes, clojure-lsp provides Calva with refactor-rename. Place the cursor on the alias or a symbol qualified by the alias. Press F2 .

mmer12:11:09

Is there an option to change :refer :all to :as alias-name? and then change the calls?

pez12:11:14

I don’t think so. But someone in #CPABC1H61 might know better than I do.

mmer12:11:47

There are shown some options in Quick Fixes but when you click on them the say command not found.

pez12:11:57

Can you give an example for “some options”?

pez12:11:47

Interesting. We may need to do something in Calva to provide that. I didn’t know it existed even (as I have already revealed).

pez12:11:52

Meanwhile: There might be a way to do it from the command line with clojure-lsp. Or from an editor that has the necessary glue, such as Emacs with clojure-lsp mode and I think also IntelliJ has a plugin for it these days.

FlavaDave21:11:41

Does anyone have issues with the repl output buffer not printing the full error message? is something I can fix with settings?

Bob B21:11:05

Do you have a repro with expected and actual outputs? Is calva truncating something that a CLI repl (or nREPL) isn't truncating?

Bob B21:11:14

a quick attempt at repro'ing this with a 4000-character error msg prints the whole thing:

(throw (ex-info (apply str (repeat 1000 "abc ")) {}))
this prints a whole lot of 'abc's

FlavaDave21:11:16

calva:

clj꞉tuchos.config꞉> 
; Execution error (ExceptionInfo) at schema.core/assert-schema (core.clj:33).
; Value does not satisfy schema
spacemace: the repl buffer is the same as above but another buffer opens
Unhandled clojure.lang.ExceptionInfo
   Value does not satisfy schema
   {:error-value nil,
    :explanation {:namespace/key ["missing required key"]},
    :type :schema-validation-error}

Bob B21:11:16

Just to clarify, am I understanding that the 'REPL output window' is identical in both, but that spacemacs does an extra thing?

pez21:11:52

You can evaluate *e to get at the data there.

FlavaDave21:11:42

@U013JFLRFS8 I tried you example but modified the map

(throw (ex-info (apply str (repeat 1000 "abc ")) {:foo "bar"}))
and I got the error but the map doesn't come back.

FlavaDave21:11:11

It would be ideal to get that map back in the repl buffer because it usually has the helpful information

pez21:11:41

You can give yourself a keyboard shortcut to print the map at will.