Fork me on GitHub
#emacs
<
2021-09-17
>
cp4n13:09:23

Noob question: Been learning Emacs (Prelude) alongside Clojure. I have more experience with other editors but enjoying Emacs. However, in VS Code for example, when you sit you cursor on a function/method it will display things like definition and what types of arguments it takes. Or when suggesting autocomplete options it will know all possible functions from an imported library, not just the things you have already used in the currently open file. Does Emacs do these sorts of things too?

solf13:09:37

Yes, you can head over to #cider or #lsp (or both)

solf13:09:47

Incidentally, CIDER’s maintainer is the author of Prelude

2
cp4n14:09:36

Oh cool, I had no idea. Thank you

pavlosmelissinos14:09:03

Like @U7S5E44DB said it's possible, e.g. this is what it looks like for me

2
👍 2
anonimitoraf15:09:40

lsp-ui-peek for something like this

👍 4
2
pavlosmelissinos15:09:13

For core functions there's also cider-clojuredocs, which opens the function's clojuredocs page on a separate buffer! (I'm not a huge fan of pop-ups)

2
cp4n15:09:15

This is all exactly what I was looking for - thanks everyone!

practicalli-johnny19:09:09

Cider will understand your functions when they are evaluated in a running REPL, then Cider will show docs and arguments, etc LSP runs a process to continually analyse the project source code, providing many IDE style functions and information. So you can use Cider by itself, or add Clojure LSP to complement

practicalli-johnny19:09:55

There are a number of videos of Emacs in action at https://practical.li/spacemacs/

cp4n19:09:57

ahh I see. Doesn't look like Prelude has clojure-lsp already. The Prelude docs mentions it as a Cider alternative but says you can use alongside it as well

vemv21:09:48

CIDER (or what have you) with https://company-mode.github.io/ is such a nice experience