Skip to content

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

Closed
@vedang

Description

@vedang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions