Fork me on GitHub
#calva
<
2022-08-08
>
k3nj1g08:08:08

Hi. How can I disable autorequire on completion when using full namespace?

Lukas Domagala10:08:05

I think that's a clojure-lsp feature. You probably have to disable it in its config, if that's an option

bringe00:08:48

Clojure-lsp returns a code action that you can invoke to do that, but I don’t know that it supports doing that itself, so I’m not sure what’s doing that. I didn’t see anything about it in the docs, at least. @UKFSJSM38 Does clojure-lsp automatically add missing requires if some setting is enabled? (The above does not happen for me if I try with clojure.string.)

ericdallo01:08:22

That's a clojure-lsp feature, if you select a completion item that is a alias or namespace and those exists/were already required previously in the project, clojure-lsp will add that require. ATM is not possible to opt-out, but I'd like to understand why one would like that, maybe there is something to be improved o server side

👍 1
k3nj1g07:08:34

We are ofthe using function from separate namespace for debug. In order not to specify each time in list of requires we use if fully qualified namespace.

1
pinkfrog12:08:03

Looks like the function parameter hint,e.g, picture, is missing for multimethod. Or am I missing some configuration?

pez13:08:30

There is no configuration for this. It might be that cider-nrepl does not return the parameter info needed, or that it has a different format for multi-methods. You can investigate a bit by using the command Calva Diagnostics: Toggle nREPL Logging Enabled and check the messages sent and received. I have a feeling it might be something that makes it difficult to gather the args-list for multimethods.

pinkfrog14:08:14

Hovering on the defmethod symbol example gives nothing.

-> sent
{
  op: 'info',
  ns: 'foobar',
  symbol: 'example',
  id: '3637',
  session: '664272c8-6cad-4c81-afab-e0fa8a1631ba'
}

<- received
{
  column: 1,
  file: 'file:/Users/pinkfog/dev/clj/src/foobar.clj',
  id: '3636',
  line: 217,
  name: 'example',
  ns: 'foobar',
  session: '664272c8-6cad-4c81-afab-e0fa8a1631ba',
  status: [ 'done' ]
}
code
(defmulti example (fn [x] x))

(defmethod example ::a
  [x]
  x)

pez14:08:35

It tells me that there is no args-list info there. Compare with the response for a regular function.

pinkfrog15:08:19

yup. I am more clear about the scope and responsibility between calva and cider-nrepl.

pez13:08:47

Please thread extra info like this together with the question.