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

citre-peek-through does not work with eglot backend #177

Closed
mplanchard opened this issue Jul 26, 2024 · 2 comments
Closed

citre-peek-through does not work with eglot backend #177

mplanchard opened this issue Jul 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mplanchard
Copy link

mplanchard commented Jul 26, 2024

Describe the bug

When using citre-peek with the eglot backend, the initial peek works well, but subsequently using citre-peek-through results in the following:

citre-peek--get-tags: Can’t find definition: "IntegrationInfo" (eglot backend), "IntegrationInfo" (tags backend), "IntegrationInfo" (global backend).

Backtrace in the fold:

Backtrace
Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "rust-analyzer")
  make-process(:name "EGLOT (spec-protect/(rustic-mode))" :command ("rust-analyzer") :connection-type pipe :coding utf-8-emacs-unix :noquery t :stderr # :file-handler t)
  #f(compiled-function () #)()
  #f(compiled-function (conn slots) #)(# (:name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #)))
  apply(#f(compiled-function (conn slots) #) (# (:name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #))))
  #f(compiled-function (&rest args) #)(# (:name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #)))
  apply(#f(compiled-function (&rest args) #) # (:name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #)))
  initialize-instance(# (:name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #)))
  #f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #)(eglot-rust-analyzer :name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #))
  apply(#f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #) eglot-rust-analyzer (:name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #)))
  make-instance(eglot-rust-analyzer :name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown :process #f(compiled-function () #))
  apply(make-instance eglot-rust-analyzer :name "EGLOT (spec-protect/(rustic-mode))" :events-buffer-config (:size 2000000 :format full) :notification-dispatcher #f(compiled-function (server method params) #) :request-dispatcher #f(compiled-function (server method params) #) :on-shutdown eglot--on-shutdown (:process #f(compiled-function () #)))
  eglot--connect((rustic-mode) (vc Git "~/s/spec-protect/") eglot-rust-analyzer ("rust-analyzer") ("rust"))
  apply(eglot--connect ((rustic-mode) (vc Git "~/s/spec-protect/") eglot-rust-analyzer ("rust-analyzer") ("rust")))
  #f(compiled-function () #)()
  citre--eglot-after-jump()
  apply(citre--eglot-after-jump nil)
  citre--call-backend-fn(eglot after-jump-fn)
  citre-backend-after-jump(eglot)
  citre-peek-through()
  funcall-interactively(citre-peek-through)
  command-execute(citre-peek-through)

To Reproduce

Steps to reproduce:

Ensure you have rust-analyzer installed, and then run $ emacs -Q

Evaluate the following in the scratch buffer:

(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

(use-package citre :ensure t)
(use-package rust-mode :ensure t)

;; only necessary for me because the rust project is a nix project w/an isolated rust-analyzer, not
;; necessary if you have it installed globally
(add-to-list 'exec-path "/nix/store/m8db0w1l880a5i8lxymjf34i7xd6viyg-rust-analyzer-2024-04-29/bin/")

Navigate to any rust file, and run citre-peek on an identifier. From there, run citre-peek-through and select a target. Any target results in the error above.

System information

  • OS: NixOS 24.05
  • Emacs version: 31.0.50
  • Are you using the latest version of Citre on master branch: no, using the version on melpa stable

Additional context

n/a

@mplanchard mplanchard added the bug Something isn't working label Jul 26, 2024
@AmaiKinono
Copy link
Member

Hi, and sorry for the delay.

I got some chance to play with rust. From what I see, rust analyzer spent some time building the cache, then all the xref and Citre commands works fine:

image

My guess is you didn't run M-x eglot before using Citre commands, or the building process isn't finished.

@mplanchard
Copy link
Author

Oh no worries, I had forgotten about opening this, and I appreciate your looking into it. I resolved the issue some time ago, although I do not remember exactly what I did that fixed it.

It looks from my backtrace like that there may have been an issue in the peek window context of finding rust-analyzer, which in my environment is generally defined by a nix-shell activated by dotenv. It is quite possible that tidying up my envrc setup is what resolved the problem.

Thank you again for the checking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants