Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cider-eldoc try to display doc when point on weird symbols like on image content-type #2286

Closed
stardiviner opened this issue May 9, 2018 · 4 comments

Comments

@stardiviner
Copy link
Contributor

When use cider display image content-type. I move point backward, then CIDER REPL can't evaluate sexp anymore.

Steps to reproduce:
Toggle nrepl log messaging.
Disable eldoc-mode in CIDER REPL buffer, then display image, then movie point backward around, on the image etc. All things fine, no weird symbol in nrepl log.
Enable eldoc-mode in CIDER REPL buffer, then move point backward around, on the image, then nrepl log displays those weird symbols. then input (+ 1 1) does not work any more. even though I disable eldoc-mode again.
Here is the nrepl log:

(-->
  id         "25"
  op         "eldoc"
  session    "07c655d4-444b-43c4-a695-43a9da90104e"
  time-stamp "2018-05-08 11:42:29.972220486"
  ns         "user"
  symbol     "\266J\206\306\251\347\355"
)
(-->
  id         "26"
  op         "eldoc"
  time-stamp "2018-05-08 11:42:35.941183374"
  ns         "user"
  symbol     "\266J\206\306\251\347\355"
)
(-->
  id           "27"
  op           "eval"
  time-stamp   "2018-05-08 11:42:41.580182208"
  code         "(print \"hi\")"
  column       7
  content-type "true"
  file         "*cider-repl localhost*"
  line         335
  ns           "user"
)

This weird symbol is from display image which eldoc try to get doc for them.

Guess might cider-eldoc need to filter on non-standard symbols?
With reference as background to original issue: #2277

@bbatsov
Copy link
Member

bbatsov commented May 9, 2018

I can't test/fix this, as the image display doesn't work for me at all as mentioned in #2277.

I'm also puzzled how the two can be related at all. I'd expect that eldoc simply won't work, but it should not break eval.

@stardiviner
Copy link
Contributor Author

I guess because cider-eldoc send cider/nrepl request to REPL code. This request not finished or other reasons, then CIDER is blocked. further sexp are not evaluated anymore.

@stardiviner
Copy link
Contributor Author

You can test with a simple call:

(cider-sync-request:eldoc "\266J\206\306\251\347\355")

P.S I just copied the weird text, but it might direct copy is not original weird character.

@stardiviner
Copy link
Contributor Author

About upper cider-eldoc op cause nrepl connection crash problem. I found why now. Because the funciton cider-repl--display-image pass image and image data (should be string) to function insert-image. I will send a PR ASAP.

bbatsov pushed a commit that referenced this issue May 19, 2018
Basically we were sending image binary data where a string was expected.

This commit also addresses one unused variable binding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants