Fork me on GitHub
#calva
<
2019-10-11
>
macgyver01:10:37

when trying to view the docstring for this function by typing (doc foo) into calva, I get CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc in this context.... Am I doing something wrong?

(defn foo
  "I don't do a whole lot."
  [x]
  (println x "Hello, World!"))

pez04:10:54

That looks right. I think you need to use some namespace, or something, for doc to be available. Iirc I’ve added a command for that, forgot what I named it though...

pez04:10:53

It is less of a problem in Calva, since it shows docs on hovering on the symbol.

pez05:10:50

@adamfranzen The command is Calva: Require REPL utilities, like (doc) etcetera, into Current Namespace ctrl+alt+c ctrl+u.

pez05:10:17

@brandon.ringe: You should maybe add that command to your getting-started guide. I think people following Clojure tutorials will often get to know about how they can use doc, and source, etcetera to find out about things.

bringe13:10:12

Noted. Thanks

metal 4
bringe13:10:54

@pez Since lein repl requires/uses the clojure.repl namespace at startup by default, do you think Calva should do the same?

bringe14:10:07

And maybe it only refers source and doc, I'm not sure, would have to look. Just wondering if the Calva repl should mimic to reduce confusion.

pez15:10:19

We should consider loading that by default. Not sure how global it gets though.

kjothen16:10:12

Is it possible to adjust the line length for the built-in clj repl? Currently it’s at 1024 characters, but I would like it wider...thanks!

pez17:10:12

There is no setting for that currently. But please file an issue about it.

kjothen17:10:45

Thanks very much - raised as #393.

❤️ 4
pez18:10:33

Thanks for the issue. You might get away a bit by evaluating inline (in a file) , either using the replace command or by copying the results from the hover.