Closed jackkamm closed 6 years ago
Thank you ! I've pushed a fix
This bug may have returned.
If I create a minimal environment in a fresh image, with just emacs, lsp-mode, lsp-ui, lsp-pyright, and flycheck installed, if I access a .py file from its real path, flycheck errors are shown as highlighted in the buffer. If I access it through a symlinked directory, I get the behaviour above. lsp-ui-flycheck-list
sees my errors, but they aren't indicated otherwise.
Minimal .emacs:
;; ---- Package Management (package.el, melpa) ----
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;; From: https://emacs-lsp.github.io/lsp-mode/page/installation/
(use-package lsp-mode
:init
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "C-c l")
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
(python-mode . lsp)
;; if you want which-key integration
(lsp-mode . lsp-enable-which-key-integration))
:commands lsp)
(use-package lsp-ui :commands lsp-ui-mode)
;; From: https://emacs-lsp.github.io/lsp-pyright/
(use-package lsp-pyright
:ensure t
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))) ; or lsp-deferred
lsp-ui-flycheck has problems when editing a file through a symlink.
In particular, syntax errors within the buffer are not highlighted by flycheck; furthermore functions such as
flycheck-list-errors
,flycheck-next-error
, etc. will not find any errors.However, calling
lsp-ui-flycheck-list
works fine, and will correctly find errors/warnings and list them in the sidebar.I believe the issue is in the function
lsp-ui-flycheck--start
withinlsp-ui-flycheck.el
, around line 169:replacing
buffer-file-name
with(file-truename buffer-filename)
fixed the issue in my case.