Fork me on GitHub
#spacemacs
<
2020-04-09
>
jaide17:04:31

Say you just saved a .dir-locals.el file, how do you get spacemacs to start using it?

practicalli-johnny19:04:45

Reload or revert any buffer in the same project as the .dir-locals.el file

zane20:04:03

Re-running clojure-mode (or clojurec-mode, or …) also seems to work.

aisamu17:04:21

I recall calling hack-dir-local-variables-non-file-buffer and it did work

jaide17:04:48

Thanks! I'll give it a shot.

aisamu17:04:41

(Might not propagate to all buffers, though)

didibus17:04:14

No, REPL is very different from your typical LSP server. Forgetting LSP, because that's more of a protocol interface, but it comes into play because its protocol isn't designed for REPL.

didibus17:04:30

A REPL does not sync with the source code

didibus17:04:26

It lives as a separate entity. LSP servers and other such static analysis tools are meant to provide feedback based on the source code, and are never out of sync and shouldn't be.

didibus18:04:03

This is because anything trying to not only understand the code, but actually run it faces all kind of additional issues, the code can be broken and fail to evaluate for example, it can perform side effects, etc. And it might not be possible to perfectly synchronized the loaded environment of a REPL with source code as it's changing

didibus18:04:25

Might also not be desired to do so (like when you want to keep state around in the REPL)

didibus18:04:05

In that sense, I think both could be complimentary

didibus18:04:12

I'll give a little example. In Cursive, auto-complete is driven by the source code. In Cider, it is driven by the REPL.

didibus18:04:32

So in Cider, until I send a form to the REPL to be evaluated it can't auto-complete it, even if it appears in my source code. In Cursive, if I send a form to the REPL that isn't in my source code, because I typed it in the REPL input and not on a source file, or.because I've deleted it, it can't auto-complete it.

didibus18:04:22

The "dream" editor would do both in my mind. It would understand the source code itself and provide features based on that, and it would complement those with a live REPL if one is connected and add all the send to repl evaluation and loading logic.

didibus18:04:07

Cider + clj-kondo/joker gets pretty close to this. There's a bit more that Emacs could do from just the source code, but still it's very good.

borkdude18:04:21

@didibus This tool uses clj-kondo to generate a TAGS file which you can then use in emacs: https://github.com/sogaiu/alc.index-defs

borkdude18:04:37

disclaimer: I've only used this a couple of times

didibus18:04:05

Ya, I started looking into trying to add clj-kondo auto-complete to Emacs. I'm not a fan of the etags, don't like all the files it needs to create. But I'm still learning a bit how Emacs handles auto-complete, seeing what can be done.

didibus18:04:54

I saw there is this thing called Semantic, wondering if it can be used, anyways... Just wanted to explain a conceptual difference