Skip to content

no applicable method reported from xref-find-definitions #148

@wanghaiqiangk

Description

@wanghaiqiangk

When invoking xref-find-definitions which is bound to M-. at a symbol, the echo area says no applicable method: xref-backend-definitions, citre, <symbol-name-here>.

This happens after I updated citre from a relative old release to the latest version.

The backtrace after enabling debug-on-entry is shown below:

Debugger entered--entering a function:
* cl-no-applicable-method(#s(cl--generic :name xref-backend-definitions :dispatches ((1 #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1fcdee8ad43f>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1fcdee8ad42f>))) (0 #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority 100 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1fcdee8ac19d>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1fcdee8ac17d>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1fcdee8ad43f>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1fcdee8ad42f>)))) :method-table (#s(cl--generic-method :specializers ((eql 'citre) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend symbol) "Method for xref to find definitions of SYMBOL." #<bytecode 0xed7061>)) #s(cl--generic-method :specializers ((eql etags) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend symbol) #<bytecode 0xe9c25d>)) #s(cl--generic-method :specializers ((eql eglot) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend id) #<bytecode 0xed59e1>)) #s(cl--generic-method :specializers ((eql dumb-jump) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend prompt) #<bytecode 0xe32c29>)) #s(cl--generic-method :specializers ((eql elisp) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend identifier) #<bytecode 0x1fcdeea1cd6d>))) :options nil) citre "comm_init")
* apply(cl-no-applicable-method #s(cl--generic :name xref-backend-definitions :dispatches ((1 #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1fcdee8ad43f>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1fcdee8ad42f>))) (0 #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority 100 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1fcdee8ac19d>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1fcdee8ac17d>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1fcdee8ad43f>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1fcdee8ad42f>)))) :method-table (#s(cl--generic-method :specializers ((eql 'citre) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend symbol) "Method for xref to find definitions of SYMBOL." #<bytecode 0xed7061>)) #s(cl--generic-method :specializers ((eql etags) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend symbol) #<bytecode 0xe9c25d>)) #s(cl--generic-method :specializers ((eql eglot) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend id) #<bytecode 0xed59e1>)) #s(cl--generic-method :specializers ((eql dumb-jump) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend prompt) #<bytecode 0xe32c29>)) #s(cl--generic-method :specializers ((eql elisp) t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (backend identifier) #<bytecode 0x1fcdeea1cd6d>))) :options nil) (citre "comm_init"))
* #f(compiled-function (&rest args) #<bytecode 0x10ab7f1>)(citre "comm_init")
* apply(#f(compiled-function (&rest args) #<bytecode 0x10ab7f1>) citre "comm_init")
* xref-backend-definitions(citre "comm_init")
* #f(compiled-function () #<bytecode 0x221f90d>)()
* xref-show-definitions-buffer(#f(compiled-function () #<bytecode 0x221f90d>) ((window . #<window 3 on core.c>) (display-action) (auto-jump)))
* xref--show-defs(#f(compiled-function () #<bytecode 0x221f90d>) nil)
* xref--find-definitions("comm_init" nil)
* #f(compiled-function (identifier) "Find the definition of the identifier at point.\nWith prefix argument or when there's no identifier at point,\nprompt for it.\n\nIf sufficient information is available to determine a unique\ndefinition for IDENTIFIER, display it in the selected window.\nOtherwise, display the list of the possible definitions in a\nbuffer where the user can select from the list.\n\nUse \\[xref-go-back] to return back to where you invoked this command." (interactive #f(compiled-function () #<bytecode 0x1693925>)) #<bytecode 0xe19335>)("comm_init")
* apply(#f(compiled-function (identifier) "Find the definition of the identifier at point.\nWith prefix argument or when there's no identifier at point,\nprompt for it.\n\nIf sufficient information is available to determine a unique\ndefinition for IDENTIFIER, display it in the selected window.\nOtherwise, display the list of the possible definitions in a\nbuffer where the user can select from the list.\n\nUse \\[xref-go-back] to return back to where you invoked this command." (interactive #f(compiled-function () #<bytecode 0x1fdd6bd>)) #<bytecode 0xe19335>) "comm_init")
* xref-find-definitions("comm_init")
  funcall-interactively(xref-find-definitions "comm_init")
  call-interactively(xref-find-definitions nil nil)
  command-execute(xref-find-definitions)

Besides, the xref-backend-functions variable has the value of (citre-xref-backend t). Manual calls to citre-jump work fine.

Any idea what's the problem here?


Citre config

(use-package citre
  :defer t
  :init
  (require 'citre-config)
  :config
  (setq
   citre-peek-fill-fringe nil
   citre-completion-case-sensitive nil
   ;; citre-project-root-function #'projectile-project-root
   citre-use-project-root-when-creating-tags t
   citre-prompt-language-for-ctags-command t))

Update Found that it's the 84bf573 refactor: pluggable backend design caused the problem.

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