我写其它语言也经常遇到不更新的问题,我是写了一个重启所有对应lsp的函数,然后绑定了一个快捷键
(defun my/restart-lsp ()
"Restart all language servers of current buffer"
(interactive)
(pcase (lsp-workspaces)
(`nil (lsp))
(workspaces (dolist (w workspaces)
(lsp-workspace-restart w)))))