Fork me on GitHub
#lsp
<
2022-04-12
>
iarenaza14:04:12

@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 🙏

ericdallo14:04:21

Sure, master is already using it, it'll be available on next release which I intend to do this week yet

borkdude15:04:22

@U8T05KBEW You can install the nightly. @ericdallo knows which bash one-liner you should use

ericdallo16:04:59

curl -O 
chmod a+x install
sudo ./install --version nightly

iarenaza19:04:30

Thanks a lot!!!

Karol Wójcik19:04:37

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 depssrc/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.

ericdallo19:04:40

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 arities

ericdallo19:04:17

2. it should not highlight on the minibuffer, that is other feature called signatureHelp

ericdallo19:04:26

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

ericdallo19:04:26

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 there

Karol Wójcik19:04:12

3. What is exactly required on my side to provide?

Karol Wójcik19:04:50

2. Oh, got it. May I create an issue on clojure-lsp side?

ericdallo19:04:05

> 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

ericdallo19:04:28

Also, next time a thread for each issue may be better to discuss 😂

😆 2
Karol Wójcik19:04:09

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?

ericdallo21:04:15

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.

ericdallo21:04:40

hover prints using eldoc

ericdallo21:04:17

Signature help using posframe (I don't use it with eldoc)

Karol Wójcik07:04:49

Huh. How can I enable posframe?

ericdallo12:04:00

and trigger it with C-Shift SPC