Fork me on GitHub
#cider
<
2016-08-07
>
malabarba00:08:33

Not that I know of

malabarba00:08:58

Print-length only limits the number of elements printed. Not the actual size

radon17:08:25

@borkdude: You could of course do something like

(defn print-lines [lines obj] (->> obj str (clojure.string/split-lines) (take lines) (clojure.string/join \newline) println)
(disclaimer: written in Slack, not tested)

radon17:08:05

I’m not getting company completion suggestions for the . namespace, in CIDER. Any other namespace is fine—as long as my.ns is loaded, I can type my.ns/ and be rewarded with a pop-up list of vars from my.ns. But not so with ./. I am sure the namespace is loaded, since I can call functions from it, e.g. (./doc clojure.string/split-lines) since I have injected my utility functions into ., but the cider/company integration doesn’t seem to work. I have also tried company-manual-begin, but no luck.

radon17:08:09

Does anyone have insight on this? I was thinking it might be because the CIDER backend is limiting completion options to Java method calls since the symbol begins with ....

dpsutton17:08:57

there's a compnay minumum prefix length to prevent it from autocompleting when the suggestion space is too large. I think it defaults to 3. maybe kick this down to 2?

dpsutton17:08:46

but this would only be if no suggestions are shown.

radon17:08:55

Yes, no suggestions are shown.

dpsutton17:08:02

ah then try that

radon17:08:18

No luck, I already have that set to 1.

radon17:08:03

This actually is not a cider/company thing, or indeed a cider thing. I think the problem is in cider-nrepl.

radon17:08:17

That’s where the completion list really comes from.

radon17:08:41

FWIW, tab completion works as expected with the . namespace in a regular lein repl—just not from emacs, through cider-nrepl.

radon18:08:31

OK, I’ve been doing some heavy code tracing, and this actually goes all the way back to https://github.com/alexander-yakushev/compliment!

radon18:08:52

I had never even heard of this library, but apparently it powers all the completions in cider and vim-fireplace!

radon19:08:44

I’ll still need to figure out how to inject the fix into my current setup, though, because I anticipate it will take a long time before this percolates all the way up into CIDER.

radon21:08:44

Adding the following code to the :injections vector of my profiles.clj resolves the problem for me without need for any changes upstream. Be warned, this is a very ugly hack!

(alter-var-root
  #'cider.inlined-deps.compliment.v0v3v0.compliment.sources.ns-mappings/var-symbol?
  (constantly (constantly true)))