From 7ae862de9e85bf58aba1bda0c119459a6fbf273d Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Mon, 29 Mar 2021 22:32:33 +0100 Subject: [PATCH] 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 --- lisp/progmodes/eglot.el | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.39.2