help strings not formatted as expected
Hi Pez,
I made a minimal repo for a shadow-cljs project that requires fulcro and replicated this issue on my machine.
https://github.com/jamiepratt/calva-help-string
Here's a screenshot of the doc string displayed when hovering over the function name:
In this case my workaround of hovering over the first param is not displaying a helpstring at all, not sure why it worked in my code base and is not working here.
Jamie
Hi! Thanks for reporting. I can reproduce it.
What trips Calva up is the indentation before the list. We can make the foo function in the repro misbehave the same way, like so:
(defn foo
"Increments x if it is positive, otherwise returns x.
- x: a number
- returns: a number"
[x]
(if (pos? x)
(inc x)
x))
Not sure what we can do about it. We use VS Code API for making a MarkdownString from the doc string. Maybe the indents are non-standard Markdown?
It seems like clojure-lsp handles it, though. Disconnecting the REPL we get nicely formatted doc strings. Maybe that was what made your workaround work, cojure-lsp got to handle it, or something.