I am using emacs27 with macOS, installed with brew cask install emacs command. After updated my emacs version from 26 to 27, company-mode stop working when I edit my rust code with rust-analyzer back end.

Here is the error message :

LSP :: Error from the Language Server: content modified (Unknown error)

Any idea what's wrong with my setting?

(use-package company
  :defines (company-dabbrev-ignore-case company-dabbrev-downcase)
  (setq company-auto-complete nil)
  (setq company-idle-delay 0)
  (setq company-require-match nil)
  (global-company-mode 1)
  (define-key company-active-map (kbd "C-n") 'company-select-next)
  (define-key company-active-map (kbd "C-p") 'company-select-previous)
  (define-key company-search-map (kbd "C-n") 'company-select-next)
  (define-key company-search-map (kbd "C-p") 'company-select-previous))

(use-package flycheck
  :config (global-flycheck-mode))
(use-package lsp-mode
 :custom((lsp-prefer-flymake nil)
 (lsp-auto-configure t)
 (lsp-rust-server 'rust-analyzer)
 (lsp-keep-workspace-alive nil))
 :hook (lsp-mode . lsp-enable-which-key-integration))

(use-package company-lsp
  :config (push 'company-lsp company-backends)
  :custom (company-lsp-async t))

(use-package rust-mode
 :hook (rust-mode . lsp)
 :custom ((lsp-rust-server 'rust-analyzer)
 (lsp-rust-analyzer-server-command '("~/.cargo/bin/rust-analyzer"))
 (lsp-rust-analyzer-display-parameter-hints t)
 (lsp-rust-analyzer-display-chaining-hints t)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.