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

Completion Popup causes cider-docview-render to error when symbol being completed does not have a docstring. #3763

Open
vedang opened this issue Dec 18, 2024 · 0 comments · May be fixed by #3764

Comments

@vedang
Copy link
Contributor

vedang commented Dec 18, 2024

Expected behavior

Completion works without throwing a backtrace

Actual behavior

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("\n  " "\n" nil)
  cider-docstring--format(nil)
  (cider-docstring--trim (cider-docstring--format fetched-doc))
  ...
  cider-docview-render(#<buffer *cider-doc*> #("some-symbol" 0 1 (ns "tech.unravel.some.ns.core" type "function")) (dict "status" ("done") "arglists-str" "[some]" "column" 1 "file" "file:/path/to/core.clj" "id" "73" "line" 107 "name" "some-symbol" "ns" "tech.unravel.some.ns.core" "session" "d0de2276-b315-40fc-a5dc-e2c3a2720e01" "time-stamp" "2024-12-18 16:01:59.332041000") :compact)
  cider-create-doc-buffer(#(("some-symbol" 0 1 (ns "tech.unravel.some.ns.core" type "function")) :compact)
  cider-create-compact-doc-buffer(#("some-symbol" 0 1 (ns "tech.unravel.some.ns.core" type "function")))
  corfu-popupinfo--get-documentation(#("some-symbol" 0 1 (ns "tech.unravel.some.ns.core" type "function")))
  corfu-popupinfo--show(#("some-symbol" 0 1 (ns "tech.unravel.some.ns.core" type "function")))

Steps to reproduce the problem

  • Use corfu for completion
  • Try to complete a symbol where the first completion does not have a docstring
  • Wait a short while (2s by default) for corfu to try creating a info popup
  • See the backtrace

Environment & Version information

CIDER version information

;; CIDER 1.16.1 (Kherson), nREPL 1.3.0
;; Clojure 1.12.0-2, Java 23.0.1

Lein / Clojure CLI version

Clojure CLI version 1.12.0.1488

Emacs version

GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin22.6.0, NS appkit-2299.77 Version 13.6.7 (Build 22G720)) of 2024-07-02

Operating system

MacOS version 15.2

JDK distribution

openjdk version "23.0.1" 2024-10-15

vedang added a commit to vedang/cider that referenced this issue Dec 18, 2024
Sometimes, there is no "doc" attribute in the nrepl-dict. In such
cases, `fetched-doc` is nil, which causes `cider-docstring--*`
functions to error.

We should only call these functions when we have a docstring to
render.

Fixes: clojure-emacs#3763
@vedang vedang linked a pull request Dec 18, 2024 that will close this issue
1 task
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

Successfully merging a pull request may close this issue.

1 participant