This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-01
Channels
- # aleph (6)
- # announcements (37)
- # aws (1)
- # beginners (67)
- # calva (9)
- # clerk (5)
- # clj-kondo (3)
- # clojure (19)
- # clojure-europe (40)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-uk (5)
- # clojuredesign-podcast (7)
- # clojurescript (28)
- # datomic (9)
- # emacs (8)
- # figwheel-main (4)
- # fulcro (6)
- # hyperfiddle (19)
- # integrant (4)
- # java (9)
- # lsp (131)
- # malli (9)
- # missionary (85)
- # off-topic (13)
- # pathom (3)
- # polylith (11)
- # releases (1)
- # sci (4)
- # shadow-cljs (7)
- # specter (2)
- # vscode (1)
- # xtdb (2)
Something I’ve missed after returning to clojure after a stint in Python is the extra popup their LSP does while you’re typing. Here’s what’s happening in this recording: • I’m typing out a fn call, as I type it brings up a small popup containing only the fn name, its args, and its docstring • When I call a fn in the original fn’s arguments, it switches the popup to that fn, and when I complete it and close the parens, it switches back to the parent args • After completing the call, I go to both fns and hit ⌘K-I, bringing up the hover. The hover that shows up is different than the popup that appeared as I typed, it contains more complete type info and some quick actions When I’m writing Clojure, I find I tend to write out the fn name, hit ⌘K-I, read the args, write one or two fo the args, then go back to the fn name, hit ⌘K-I, go back to the end of the form, write the next arg, etc. That back-and-forth feels much less comfortable than the Python version where the arg list just stays with me the whole time and even highlights the arg I’m on as I go. Would it be possible for Calva to do this sort of thing? For example, to have the “type-as-you-go” hover just contain arg names and the docstring, and have the clojuredocs available at the longer ⌘K-I/hover popup when you request them
That's expected to happen and the logic should come from clojure-lsp, the problem we may face is that on Lisp it may not be entirely equal to python
That’s called Parameter Hints in VS Code. I think Calva is disabling it for Clojure (I’ve forgotten why, but anyway.) Search for @id:editor.parameterHints.enabled @lang:clojure
in the settings window to toggle it on. And a search for parameter
will show you some more configuration options.
Disabling it as default seems to have been a requests from enough users: https://github.com/BetterThanTomorrow/calva/issues/574
Without a REPL connection clojure-lsp provides it. It then also contains the docstring. The REPL version enables this too on a separate setting.