Fork me on GitHub
#emacs
<
2022-10-26
>
mpenet10:10:51

trying out eglot today, since it was in the news lately. So far so good, most of the stuff that I used to dislike about it was fixed since last time I tried it. But there's still one important missing bit, it can't jump to defs inside a dependency like lsp-mode does.

mpenet10:10:54

then about the move to core emacs, personally I am not a fan, it makes pulling "nightly" changes a bit tricky and the discussions are scattered in 2 places now

upvote 1
mpenet10:10:46

there's a patch in the works for this tho : https://github.com/joaotavora/eglot/issues/661

ericdallo10:10:11

Yep, we are discussing some options there

👍 1
lispers-anonymous12:10:24

As long as the clojure-lsp configuration value :dependency-scheme is "zipfile" (currently the default), then loading up this elisp allows you to navigate to jars https://git.sr.ht/~dannyfreeman/jarchive/tree/main/item/jarchive.el

mpenet14:10:56

oh nice, I have to try it out

mpenet14:10:35

the path it sends me to seems wrong: it's something like /foo/bar/baz/file:/home/mpenet/<...>. Without the prefix (current dir, it would work)

lispers-anonymous14:10:04

Can you view the contents?

mpenet14:10:16

no, it creates a new buffer on that location

mpenet14:10:33

If I try to open the jar path separately I suppose it would work

mpenet14:10:41

my setup might just be broken

mpenet14:10:46

(use-package jarchive
  :straight (jarchive :type git
                      :host nil
                      :repo "")
  :hook ((clojure-mode . jarchive-setup)
         (clojurec-mode . jarchive-setup)))

mpenet14:10:50

I only did that

lispers-anonymous14:10:00

I don’t know much about straight, but assuming it’s loaded, can you call M-x jarchive-setup before using xref-find-definitions ?

mpenet14:10:18

jarchive--file-name-handler is first in file name handler alist

mpenet14:10:25

so I guess it should work

lispers-anonymous15:10:00

Update: resolved the issue in dm. :dependency-scheme was set to "jar".

mpenet15:10:27

yes, I assumed I never modified that, but I had apparently

ericdallo10:10:57

@yyoncho made a POC of A Emacs fork implementing non-blocking and async JSONRPC support. I still need to test it myself, but he said is way faster than current Emacs sync JSONRPC support https://github.com/emacs-lsp/emacs

nice 3
🚀 1
❤️ 1
👀 1
elken14:10:37

Ah glad he's here too 😁 I've posted it on doomscord for a few others to try

👍 1
Carlo19:10:18

When I hover on the name of a declaration, like foo in:

(def foo
  ,,,)
emacs will suggest in the minibuffer the complete name: my.namespace/foo. How can I copy the complete name of an identifier in the clipboard?

lispers-anonymous20:10:07

I don’t have a straightforward way to get it into the clipboard, but executing the command eldoc-doc-buffer ought to open a buffer where you can copy the contents from.

Carlo20:10:54

Thank you! So that seems to work when I have no cider open. Otherwise it returns:

def: ([def symbol doc-string? init?])

lispers-anonymous20:10:38

Huh, when cider is open does my.namespace/foo still appear in the minibuffer?

Carlo20:10:48

so, that def: ... stuff appear first, as I move the cursor my.namespace/foo appears again

Carlo20:10:46

it seems that I'm getting two streams of information, but when I actually invoke the function I only get def: ([def symbol ...])

lispers-anonymous20:10:43

Yeah, I think some of it is coming from cider-doc and not eldoc. You might try making sure the foo-form is evaluated by cider. And with that, using cider-doc instead of eldoc-doc-buffer

lispers-anonymous20:10:03

That’s a ways off from just wanting it dumped into the clipboard though. You might be able to write a custom function to do it with what is available in cider.

Carlo20:10:02

Thank you for pointing me in the right direction @UDVJE9RE3! I ended up with:

(defun med/select-namespaced-symbol ()
  (interactive)
  (let* ((sym  (symbol-name (symbol-at-point)))
         (info (cider-var-info sym))
         (docstring (cider--docview-as-string sym info)))
    (kill-new (-first-item (s-lines docstring)))))

lispers-anonymous20:10:38

Very cool! Glad I could help

🙌 1