Fork me on GitHub
#lsp
<
2022-08-25
>
grzm17:08:00

Is there a way to disable snippets in clojure-lsp? (perhaps by excluding the built-in ones and configuring no additional ones?)

snoe17:08:26

You should be able to configure your client capabilities to turn off snippetSupport

grzm17:08:37

Do you happen to know what that means from an emacs/cider perspective?

snoe17:08:48

not sure for emacs, sorry.

Noah Bogart19:08:50

I think related to :async-custom-lint?, at some point, when I called codeAction on a fully-qualified symbol, it would suggest Add require '[clojure.string :as str]' x 20 and the number would be the current number of times each suggested alias is used in the app. Now it only says '[clojure.string :as str] x 1 for each of the suggestions

Noah Bogart19:08:06

1. Add require '[clojure.string :as cstr]' x 1
2. Add require '[clojure.string :as cstring]' x 1
3. Add require '[clojure.string :as s]' x 1
4. Add require '[clojure.string :as st]' x 1
5. Add require '[clojure.string :as str]' x 1
6. Add require '[clojure.string :as string]' x 1

ericdallo19:08:55

I think this is "expected" on server side, we only show correctly the count for alias not full namespaces

👍 1
ericdallo19:08:14

Not sure if it's a bug though

snoe20:08:15

Yeah, I noticed this too, looks like a regression to me.

walterl19:08:21

Say you have a nested form with an undefined var x used multiple times, would it make sense to automatically rename all of these xs when you rename one via lsp?

ericdallo19:08:52

do you have a pseudo code snippet example?

walterl19:08:46

Say I copied the body of this function from elsewhere, or the parameter was change to i without lsp. I'd like to rename all xs in the body to i.

(defn foo [i]
  (if (pos? x)
    (inc x)
    (dec x)))

walterl19:08:43

Btw, I'm not 100% sure that it would make sense to support this.

ericdallo19:08:10

I can see how convenient it may be, and maybe we don't even need to change anything on kondo, we could start supporting locals rename for undefined locals like that example

ericdallo19:08:38

but not for:

(def foo)

bar 

bar
trying to rename bar to foo, as that could be harder or not 100% acurate

💯 1
ericdallo19:08:04

Feel free to open an issue about allow renaming unresolved locals

👍 1
walterl19:08:59

What is this allowlist you're referring to? (I'd like to read up on it.)

ericdallo19:08:25

sorry, fixed it

👍 1
Cora (she/her)22:08:31

gah, lsp is picking the wrong project root

Cora (she/her)22:08:56

I have a git repo that has another git repo within it (the nested one is ignored) and it's insisting the outer repo is the root

ericdallo22:08:09

You can lsp-workspace-folders-remove to remove the outer project and then lsp to select the correct one

Cora (she/her)01:08:29

i'll try that in a bit

Cora (she/her)02:08:31

I reinstalled doom emacs and it just works now so I don't even know

ericdallo12:08:04

Reinstalling doom probably reseted the lsp workspaces

Cora (she/her)13:08:26

that was my guess, something about caching lsp directories

Cora (she/her)22:08:12

oh well, I'll fix it tomorrow