From c6fdc804a5b714384678ec241770f31aee334753 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 7 Jul 2020 05:34:19 +0200 Subject: [PATCH] Emacs: Replace company-lsp with company-capf. company-lsp is no longer supported and will be deprecated soon. --- init.d/programming/lsp.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/init.d/programming/lsp.el b/init.d/programming/lsp.el index 7371b78..9d7babb 100644 --- a/init.d/programming/lsp.el +++ b/init.d/programming/lsp.el @@ -1,6 +1,6 @@ ;;; lsp.el --- Language Server Protocol. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-07-07T05:30:48+0200> +;; Time-stamp: <2020-07-07T05:33:56+0200> ;;; Commentary: @@ -20,7 +20,8 @@ (lsp-auto-guess-root t) ; Don't ask for project root. (lsp-eldoc-render-all t) (lsp-restart 'auto-restart) - (lsp-enable-semantic-highlighting t)) ; Needs clangd 11(?). + (lsp-enable-semantic-highlighting t) ; Needs clangd 11(?). + (lsp-prefer-capf t)) :config (progn (setq lsp-clients-clangd-args '("--compile-commands-dir=build")) ;; Add “-clang-tidy” to clangd args if the version supports it. @@ -30,7 +31,10 @@ (put 'lsp-clients-clangd-args 'safe-local-variable #'consp)) :bind ("C-c C-f" . lsp-execute-code-action) :hook ((c++-mode . lsp) - (c-mode . lsp))) + (c-mode . lsp) + ;; ↓ See . ↓ + (lsp-managed-mode + . (lambda () (setq-local company-backends '(company-capf)))))) ;; Eye-candy and flycheck support for lsp-mode. (use-package lsp-ui @@ -51,13 +55,6 @@ :hook ((lsp-mode . lsp-ui-mode) (lsp-ui-peek-mode . my/lsp-ws-toggle))) - ;; Completions with lsp-mode. - (use-package company-lsp - :demand t - :after (lsp-mode company) - :custom (company-lsp-cache-candidates 'auto) - :config (push 'company-lsp company-backends)) - ;; ivy interface to lsp-mode. (use-package lsp-ivy :demand t