Skip to content

Commit

Permalink
Fix inconsistency report between eglot and flymake
Browse files Browse the repository at this point in the history
  • Loading branch information
tshu-w committed Jul 19, 2024
1 parent a3ccc79 commit 550b461
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lisp/editor-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,14 @@ Just put this function in `hippie-expand-try-functions-list'."
("pyright-langserver" "--stdio")
"jedi-language-server"))))

(defun expand-absolute-name (name)
(if (file-name-absolute-p name)
(tramp-file-local-name
(expand-file-name
(concat (file-remote-p default-directory) name)))
name))
(cl-defmethod eglot-handle-notification :after
(_server (_method (eql textDocument/publishDiagnostics)) &key uri
&allow-other-keys)
(when-let ((buffer (find-buffer-visiting (eglot-uri-to-path uri))))
(with-current-buffer buffer
(if (and (eq nil flymake-no-changes-timeout)
(not (buffer-modified-p)))
(flymake-start t)))))

(when (fboundp #'tabnine-completion-at-point)
(add-hook 'eglot-managed-mode-hook
Expand All @@ -392,6 +394,13 @@ Just put this function in `hippie-expand-try-functions-list'."

(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)

(defun expand-absolute-name (name)
(if (file-name-absolute-p name)
(tramp-file-local-name
(expand-file-name
(concat (file-remote-p default-directory) name)))
name))

;; TODO:
;; https://github.com/joaotavora/eglot/discussions/876
;; https://github.com/microsoft/pyright/issues/3282
Expand Down

0 comments on commit 550b461

Please sign in to comment.