Open matdurand opened 4 years ago
Just making a note here for later to check if clojure-lsp shows the spec in its hovers. (We'll be adding clojure-lsp soon.)
Update: It doesn't seem like clojure-lsp provides this, and now that I think about it, it does seem like more of a repl driven thing, since specs would exist on a function after the spec has been eval'd. Not to say it's impossible to do with static analysis, but it would have to take into account clojure.spec when crawling the files, I think.
In the future if we do decide to use clojure-lsp's hovers in place of Calva's for function docs (even when connected to a repl), maybe we could use Calva's provider just for things like spec docs when a repl connection exists. So lsp provides the function name, args list, and doc string, and Calva provides the spec if it exists.
It would be nice if Calva was able to display the specs of a function in the VSCode popup overlay giving the info about a function. We could leverage the
clojure.repl/doc
function that already gives the specs of a function if available.Here is the REPL output of the doc function for a demo function taken from the spec documentation:
Displaying this in the popup would be a good start.
Not sure if it would be possible for clojurescript though because I'm having issue running the
doc
function in my node repl...