Fork me on GitHub
#lsp
<
2022-01-15
>
nonrecursive00:01:30

hey y’all, is there a way to configure lsp-mode to auto-add namespace requires?

ericdallo00:01:07

we have this feature during completion

ericdallo00:01:31

but most of the time, the code actions will work lsp-execute-code-action Add require

nonrecursive00:01:03

whoa thanks for the quick reply 🙂 I’m not sure what you mean about completion? I’ve noticed when I type str/ for example then it will require clojure.string :as str. But if I type another common alias ns in my project, e.g. app/ then it won’t add that require

ericdallo00:01:43

this is not a lsp-mode feature, this is a cljr one called magick-requires

ericdallo00:01:49

but it's possible to add with lsp as well

ericdallo00:01:21

if you type str/anything, clojure-lsp will suggest a code action, you can access it with lsp-execute-code-action or SPC c a if using doom-emacs

nonrecursive00:01:33

thank you so much 🙂

ericdallo00:01:51

code actions are one of my fav features of LSP

bananadance 1
🙌 1