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

eglot + ediff-regions-wordwise errors out #116

Closed
jojojames opened this issue Sep 16, 2018 · 3 comments
Closed

eglot + ediff-regions-wordwise errors out #116

jojojames opened this issue Sep 16, 2018 · 3 comments
Labels

Comments

@jojojames
Copy link
Contributor

(setq package-enable-at-startup nil
      package-archives
      '(("melpa" . "http://melpa.milkbox.net/packages/")
        ("gnu" . "http://elpa.gnu.org/packages/")))

(require 'package)
(package-initialize)
(package-install 'eglot)

;; Visit python file.
;; M-x toggle-debug-on-error
;; M-x eglot
;; M-x ediff-regions-wordwise
;; Move cursor around to trigger eldoc.
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  file-truename(nil)
  eglot--path-to-uri(nil)
  eglot--TextDocumentIdentifier()
  eglot--TextDocumentPositionParams()
  eglot-eldoc-function()
  apply(eglot-eldoc-function nil)
  #f(advice-wrapper :before-until #f(advice-wrapper :before-until #f(compiled-function (&rest args) #<bytecode 0x406be941>) python-eldoc-function) eglot-eldoc-function)()
  eldoc-print-current-symbol-info()
  #f(compiled-function () #<bytecode 0x400def01>)()
  apply(#f(compiled-function () #<bytecode 0x400def01>) nil)
  timer-event-handler([t 0 0 500000 nil #f(compiled-function () #<bytecode 0x400def01>) nil idle 0])
  recursive-edit()
  ediff-clone-buffer-for-region-comparison("TestPython.py" "-Region.A-")
  ediff-regions-wordwise("TestPython.py" "TestPython.py")
  funcall-interactively(ediff-regions-wordwise "TestPython.py" "TestPython.py")
  call-interactively(ediff-regions-wordwise record nil)
  command-execute(ediff-regions-wordwise record)
  execute-extended-command(nil "ediff-regions-wordwise" "ediff-regions-wo")
  funcall-interactively(execute-extended-command nil "ediff-regions-wordwise" "ediff-regions-wo")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

;; M-x kill-buffer

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  file-truename(nil)
  eglot--path-to-uri(nil)
  eglot--TextDocumentIdentifier()
  eglot--signal-textDocument/didClose()
  kill-buffer("TestPython.py-Region.A-")
  funcall-interactively(kill-buffer "TestPython.py-Region.A-")
  call-interactively(kill-buffer nil nil)
  command-execute(kill-buffer)
@joaotavora
Copy link
Owner

Confirmed.

@mkcms
Copy link
Collaborator

mkcms commented Nov 7, 2018

The issue is that the buffers created by ediff are not actually visiting any files, and eglot wants to use their filename.

A couple of solutions could be:

  1. Don't enable eglot in non-file-visiting buffers
  2. Don't use features that require knowing the buffer file name
  3. Assume that the filename of current buffer is the buffer name.

I've opened #150 using the third option.

@joaotavora
Copy link
Owner

The problem is actually indirect buffers. Pushed a fix for this.

bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
…ct buffers

Indirect buffers, such as the ones created by ediff-regions-wordwise,
have eglot enabled but not buffer-file-name.  Resort to the finding
the file-name of the original buffer for these.

* eglot.el (eglot--TextDocumentIdentifier): Work in indirect
buffers.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
…ct buffers

Indirect buffers, such as the ones created by ediff-regions-wordwise,
have eglot enabled but not buffer-file-name.  Resort to the finding
the file-name of the original buffer for these.

* eglot.el (eglot--TextDocumentIdentifier): Work in indirect
buffers.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Indirect buffers, such as the ones created by ediff-regions-wordwise,
have eglot enabled but not buffer-file-name.  Resort to the finding
the file-name of the original buffer for these.

* eglot.el (eglot--TextDocumentIdentifier): Work in indirect
buffers.

#116: joaotavora/eglot#116
#150: joaotavora/eglot#150
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Indirect buffers, such as the ones created by ediff-regions-wordwise,
have eglot enabled but not buffer-file-name.  Resort to the finding
the file-name of the original buffer for these.

* eglot.el (eglot--TextDocumentIdentifier): Work in indirect
buffers.

GitHub-reference: fix joaotavora/eglot#116
GitHub-reference: fix joaotavora/eglot#150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants