From: Mohsin Kaleem Date: Mon, 29 Mar 2021 21:32:33 +0000 (+0100) Subject: Add :company-kind to eglot-completion-at-point X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~146^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7ae862de9e85bf58aba1bda0c119459a6fbf273d;p=emacs.git Add :company-kind to eglot-completion-at-point * eglot.el (eglot-completion-at-point): Add a :company-kind field to the completion-at-point function so that company can associate completion candidates with lsp types. GitHub-reference: close https://github.com/joaotavora/eglot/issues/652 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 5914f2ddd47..579ed27913e 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2236,6 +2236,13 @@ is not active." (concat " " (propertize annotation 'face 'font-lock-function-name-face)))))) + :company-kind + ;; Associate each lsp-item with a lsp-kind symbol. + (lambda (proxy) + (when-let* ((lsp-item (get-text-property 0 'eglot--lsp-item proxy)) + (kind (alist-get (plist-get lsp-item :kind) + eglot--kind-names))) + (intern (downcase kind)))) :company-doc-buffer (lambda (proxy) (let* ((documentation