Fork me on GitHub
#cider
<
2018-04-05
>
bozhidar07:04:39

@cemerick Nice to see you here! I’ve been meaning to ask you how are things going with nREPL 0.3 and how we can help you get it out the door?

ajs09:04:07

when i update from cider 14 to 16, it creates a new elpa directory entirely; is it fine to just delete the old 14 directory?

ajs09:04:18

if I didn't delete it, how would I know which version of cider is getting used?

bozhidar09:04:26

Yeah, you can remove it completely.

bozhidar09:04:43

Normally package.el should ask about deleting the old packages after an upgrade.

mgrbyte09:04:56

describe-package (bound to`C-h p` by default) would show you. Also version should be highlighted in the output of list-packages

ajs09:04:17

i've been hit now by this issue, so I'm trying all the various things in there: https://github.com/clojure-emacs/cider/issues/2140

ajs09:04:28

closed emacs, then i nuked cider from .emacs.d/elpa, restarted emacs and cider automatically re-appeared in elpa and worked. similar to others' experiences in that gh issue.

ajs09:04:33

so, should be good now

thheller10:04:14

Is there anything I can set to make the track-state middleware less "chatty"? I'm building a simple nrepl client into shadow-cljs and must account for the user having cider-nrepl active. This is fine but on any eval I get the usual results plus one :changed-namespaces message. This message is about 830kb which is a bit much given that I do not use it.

thheller10:04:52

looking at the cache it appears that this is supposed to be cached

thheller10:04:37

nevermind. I'll just remove the track-state middleware completely. forgot that I control the middleware stack.

bozhidar10:04:57

I was going to suggest this.

bozhidar10:04:31

You’ll not lose much I guess - if you’re not processing those messages the way CIDER does, they don’t add much value.

bozhidar10:04:04

But it’s a valid point we should be able to start/stop it explicitly I guess.

thheller10:04:16

hmm no can't remove it. It is connecting to the same nrepl endpoint that cider would connect to.

thheller10:04:06

I do like the track-state in that it tracks the current repl-type. just the :changed-namespaces is a bit large and for some reason the cache doesn't seem to work

bozhidar10:04:49

The idea for track state was to reduce server round trips. We keep a lot of relevant metadata on the client-side, that gets “auto-pushed” after certain ops and the client can potentially do a lot of useful things with it (cider uses it currently just for syntax-highlighting semantically vars).

bozhidar10:04:39

It seems to me that you removing it from the middleware stack would be fine, though. I don’t think it has touch points with anything else, except maybe the debugger.

thheller10:04:08

problem is that this is a web client and reading 830kb has a noticeable delay of about 500ms

thheller10:04:55

hmm maybe I just switch it to transit. that should be faster

bozhidar10:04:01

It’d very simple for us to add some “start” op that has to invoked for this to work.

thheller10:04:22

yeah problem is when I remove it on my end it won't be available to cider

thheller10:04:39

which is bad for my users that expect cider to work properly

thheller10:04:07

could spin up a secondary nrepl server without that middleware I guess

bozhidar10:04:28

I guess a better solution to be to add some “client” property to the requests so we can do different things for different clients.

bozhidar10:04:49

Or something along those lines.

bozhidar10:04:17

Anyways, CIDER will keep working even without this - only font locking will certainly be broken. Have to check about what else would be impacted.

thheller10:04:04

yeah thats not acceptable. things must work as expected 🙂

thheller10:04:45

I'll just switch to transit so the parse doesn't take that long. I think the cache doesn't work properly because I don't send the correct nrepl messages yet. I guess it relies on clone first (or whatever else I'm supposed to send first)

thheller10:04:08

sounds like a good idea for the client to send an init message on connect though. could send some info about itself and its capabilities. similar to https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#initialize-request-leftwards_arrow_with_hook

kommen14:04:21

anybody has some idea how aggressive-indent-mode can conflict with multiple cider repl connections? seeing the same issue right now as reported here: https://github.com/Malabarba/aggressive-indent-mode/issues/104

bozhidar14:04:10

@thheller You can also take a look at the code. It’s pretty simple and it will give you a good idea how this is supposed to work https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj

bozhidar14:04:54

That’s probably the most important thing - https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj#L220 The nREPL ops that trigger a cache update.

bozhidar14:04:33

@kommen - @malabarba should certainly have the best idea as wrote both aggressive-indent-mode and CIDER’s dynamic indent functionality. I can’t imagine how multiple connections might be slowing down things, unless the algorithm for determining the current connection isn’t extremely slow.

bozhidar14:04:52

It’d best to run the profiler for a bit and submit the results in the ticket you’ve created.

bozhidar14:04:00

As a workaround you can disable the dynamic indentation, as I’m assuming it’s making aggressive-indent-mode slower. I stopped using it a while ago, as I noticed it was very inefficient on any bigger source files (with or without a connection).

bozhidar14:04:35

Reindenting big buffers is simply too expensive.

kommen14:04:11

@bozhidar thanks, I’ll try to gather some more info and attach it to the issue. I too was very surprised that just closing the cider repl buffers improved the aggressive indent performance significantly

bozhidar14:04:15

It’s because when CIDER is running it augments the static indentation rules from clojure-mode (using the indentation metadata described in CIDER’s manual). That’s an optional features that gives users a lot of flexibility over the indentation of things like complex macros.

kommen14:04:40

ah, that’s what you referred to as “dynamic indentation” I guess

kommen14:04:13

thanks for the pointers, I’ll need to read up on that

bozhidar14:04:23

You’re welcome!

dominicm22:04:13

I'm worried about when they depend on different artefact names, for the new nrepl

Michael Fiano23:04:07

The documentation may have a problem. It says that :repl-options {:init (set! *print-length* 50)} to my lein profile should work, but it is ignored by cider (it only works within lein's REPL). It seems CIDER needs its own variable set, cider-repl-print-length. The docs say only the CIDER variable will take precedence if both are set, but if only the lein profile is changed, CIDER still uses its default value of 100.