Skip to content

Sideeffect checking cider--xref-backend #3170

@ericdallo

Description

@ericdallo

When doom runs (xref-find-backend) to find current xref backend, cider gives a error: No linked CIDER sessions. xref backend functions should not have side-effects like that, this is making doom's code not be able to check for other backends like lsp making users need to jack in repl to use doom's lsp find-definition for example even if not using cider find definition.

Expected behavior

(cider--xref-backend) not throw any side effects like checking if repl is available.

Actual behavior

(cider--xref-backend) checks if repl is available, throwing a error message if not.

Steps to reproduce the problem

M-x (cider--xref-backend) with a repl not enabled in a project.

Environment & Version information

CIDER version information

;; CIDER 1.3.0 (Ukraine), nREPL 0.9.0
;; Clojure 1.11.0, Java 11.0.12

Emacs version

28.0.91

Operating system

NixOS

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