Fork me on GitHub
#emacs
<
2020-08-05
>
fricze08:08:33

hi! quick question, is there a way to make go-to-definition work in emacs for clojure specs?

jumar09:08:04

[I use spacemacs] it used to work for me with cider-find-keyword for things like ::specs/non-empty-string but it doesn't work anymore. I can still do press g d (go-to-definition) and get a quick list of occurences of given symbol and usually quickly identity the place where it's defined

ericdallo12:08:48

Take a look at clojure-lsp with lsp-mode for Emacs, more info on #lsp

fricze08:08:59

I have it working for defns and defs but canโ€™t handle specs

practicalli09:08:27

@andrzej.fricze using fully qualified spec names, e.g. :practicalli.banking/account-id rather than โ›‘account-id and with the REPL running, then cider-browse-spec works well as well as the clj-find-var function in Spacemacs Clojure layer (a wrapper function around cider-find-var). With the cursor on an auto-qualified spec form, ::account-id these functions do not seem to work. If the repl is not running, the clj-find-var function used dump-jump-go which doesn't seem to work for specs https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Blang/clojure/funcs.el#L187-L195

fricze09:08:52

thanks for help guys! ๐Ÿ™‚

jjttjj12:08:10

Is there something obvious I'm missing why this isn't properly setting the keybinding:

(define-key inf-clojure-mode-map (kbd "C-c C-r") #'inf-clojure-restart)

jjttjj12:08:49

Ah, think I figured it out. I was doing

(require 'clj-refactor)
later in the .el file which I think was overriding the keybinding