From: João Távora Date: Mon, 20 Aug 2018 00:10:11 +0000 (+0100) Subject: Consider :triggercharacters in company completion X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~438 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9fa0dd072aa3277686ec581ae3075475e02dada6;p=emacs.git Consider :triggercharacters in company completion * eglot.el (eglot-completion-at-point): Take advantage of :company-prefix-length. GitHub-reference: close https://github.com/joaotavora/eglot/issues/80 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 3bd342dde6f..4f726440e29 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1384,8 +1384,9 @@ is not active." (defun eglot-completion-at-point () "EGLOT's `completion-at-point' function." (let ((bounds (bounds-of-thing-at-point 'symbol)) - (server (eglot--current-server-or-lose))) - (when (eglot--server-capable :completionProvider) + (server (eglot--current-server-or-lose)) + (completion-capability (eglot--server-capable :completionProvider))) + (when completion-capability (list (or (car bounds) (point)) (or (cdr bounds) (point)) @@ -1451,6 +1452,10 @@ is not active." (erase-buffer) (insert (eglot--format-markup documentation)) (current-buffer))))) + :company-prefix-length + (cl-some #'looking-back + (mapcar #'regexp-quote + (plist-get completion-capability :triggerCharacters))) :exit-function (lambda (obj _status) (cl-destructuring-bind (&key insertTextFormat insertText