This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-12
Channels
- # announcements (76)
- # babashka (10)
- # beginners (39)
- # biff (2)
- # calva (51)
- # chlorine-clover (8)
- # cider (6)
- # clj-kondo (15)
- # clj-on-windows (13)
- # cljdoc (26)
- # cljs-dev (8)
- # clojure (196)
- # clojure-austin (17)
- # clojure-europe (36)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-uk (2)
- # clojurescript (18)
- # community-development (4)
- # conjure (1)
- # core-typed (38)
- # cursive (5)
- # datalevin (17)
- # datomic (25)
- # docker (1)
- # events (2)
- # interop (2)
- # jobs (4)
- # kaocha (28)
- # lsp (22)
- # nyc (1)
- # off-topic (10)
- # pedestal (1)
- # portal (22)
- # re-frame (22)
- # react (10)
- # shadow-cljs (19)
- # spacemacs (7)
- # tools-deps (11)
- # vim (14)
- # xtdb (7)
@ericdallo Any chance of a near future clojure-lsp release that uses clj-kondo v2022.04.08? I'd like to use the improved protocol implementation analysis that went in that version (we are extensively using one of the protocol implementation variants that are only supported in that version). Thanks a lot in advance 🙏
Sure, master is already using it, it'll be available on next release which I intend to do this week yet
@U8T05KBEW You can install the nightly. @ericdallo knows which bash one-liner you should use
I stepped upon few issues with LSP, dunno if it's issue with my emacs. If someone could test it I would be more than grateful. Configuration: • LSP (clojure-lsp 2022.03.31-20.00.20, clj-kondo 2022.04.08)
(use-package! lsp-ui
:after lsp-mode
:commands lsp-ui-mode
:config
(setq lsp-ui-peek-list-width 60
lsp-ui-doc-max-width 60
lsp-ui-doc-enable t
lsp-ui-peek-fontify 'always
lsp-ui-sideline-show-code-actions nil))
(use-package! lsp-mode
:commands lsp
:hook ((clojure-mode . lsp))
:config
(setq lsp-headerline-breadcrumb-enable nil
lsp-lens-enable t
lsp-enable-file-watchers t
lsp-signature-render-documentation t
lsp-signature-function 'lsp-signature-posframe
lsp-semantic-tokens-enable t
lsp-completion-sort-initial-results t ;; check if should keep as t
lsp-completion-no-cache t
lsp-completion-use-last-result nil
lsp-idle-delay 1.0
lsp-lens-enable t
lsp-enable-file-watchers t
lsp-file-watch-threshold 10000
lsp-signature-auto-activate t
lsp-enable-indentation nil
lsp-enable-on-type-formatting nil))
• Emacs (https://pastebin.com/xmm2bQXk), doom-theme (doom-dracula)
• Project
◦ deps.edn
- only newest Clojure in deps
◦ src/core.clj
Issues
1. (conj! <here_cursor>)
shows full signature of a function in a minibuffer, however (conj <here_cursor>)
doesn't.
2. The signature of the function doesn't highlights the arguments while I'm filling the next parameters of a function. E.g. for (conj! [] <here_cursor>)
the signature in minibuffer should highlight (conj [] *coll* x)
, but it doesn't.
3. This issue requires 3 steps to reproduce:
a. Require [clojure.string :as string]
in ns form.
b. In the next line write by hand (string/replace)
now while inside the form remove all the characters, so that only parens are left.
c. Write inside parens conj!
. The signature in the minibuffer still shows clojure.string/replace
instead of conj!
.
Things I tried
• removal of .clj-kondo
, .lsp
, .cpcache
,
• re-installation of emacs.1. confirmed, it seems we don't show function arity for conj
we show this way:
clojure.core/conj
conj[oin]. Returns a new collection with the xs
'added'. (conj nil item) returns (item).
(conj coll) returns coll. (conj) returns [].
The 'addition' may happen at different 'places' depending
on the concrete type.
it seems kondo is not returning the arities2. it should not highlight on the minibuffer, that is other feature called signatureHelp
3. sounds like a outdated analysis because of a invalid code like ()
,not sure, maybe a issue about that with more details is a good idea
I confirmed the 1. is a kondo issue indeed, clj-kondo returns
:arglist-strs ["[]" "[coll]" "[coll x]"],
for conj!
but not for conj
Feel free to open a issue there3. What is exactly required on my side to provide?
2. Oh, got it. May I create an issue on clojure-lsp side?
> 2. Oh, got it. May I create an issue on clojure-lsp side?
No, it's not a issue, it's expected, if you want to see the highlight you want signatureHelp
feature, not hover
one
> 3.
Just detailed steps like you mentioned I think
Ok. Thanks Eric! Next time I will create a thread for every single one. 2. I think I don’t understand fully. What i know is that for some lsp clients this feature works. Is it something I should enable in lsp configuration, since it seems signatureHelp is what I want?
probably, we need to understand what your emacs is using, let me give a little explanation how it works:
• hover
this is a LSP feature that is triggered when one hover over a symbol, usually this show information like docstring, clojuredocs, function arities etc
• signatureHelp
this one is especifically to show only the function signature showing the current arg selected.
On Emacs, you can make both features show on eldoc (minibuffer), or via popups.
Huh. How can I enable posframe?
https://github.com/ericdallo/dotfiles/blob/master/.doom.d/config.el#L136 Also, install posframe via package.el