jasongilman / proto-repl-charts

An Atom Plugin extension for Proto REPL that allows displaying graphs.
MIT License
65 stars 4 forks source link

display two same chart panel at once #19

Open jrlj opened 7 years ago

jrlj commented 7 years ago

When I run the demo codes, it always open two same chart panel at once, why?

jasongilman commented 7 years ago

I've never seen that before. Can you take a look at the Atom developer console for errors? You may also want to try restarting Atom.

maxthoursie commented 6 years ago

I'm also getting this.

Steps to reproduce

(proto-repl-charts.table/table "table" [[1 2] [3 4]])


- Start repl with `ctrl+, l`
- Eval with `ctrl+, f`

This gives me two panes with the table:

![screenshot from 2018-05-11 14-14-36](https://user-images.githubusercontent.com/1250807/39923856-b23c647a-5525-11e8-9928-db3df7a3ac60.png)

The dev console is empty.

# Environment

Atom version 1.26.1 x64 on Linux

Enabled community packages:
- proto-repl 1.4.24
- proto-repl-charts 0.4.1
- 
maxthoursie commented 6 years ago

Well, it seems to be intermittent. I was able to reproduce several times with the above steps, but now, following the same steps, it works. :(

maxthoursie commented 6 years ago

TLDR: Remove cider-nrepl and it works.

After some hours of debugging, i found that I had the cider-nrepl enabled in my .lein/profiles.clj. Cider adds an extra message (changed-namespaces) in the nrepl-reply. This message comes after the status: done message, which the nrepl-client used by proto-repl doesn't expect.

For every message after done, it will send the whole list of messages to the callback again. This can probably be considered a bug in the nrepl-client. The relevant code is here:

https://github.com/rksm/node-nrepl-client/blob/master/src/nrepl-client.js#L126

https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj#L199