3

my emacs lsp-python setup is pretty standard:

(require 'lsp-mode)
(add-hook 'python-mode-hook #'lsp)
(require 'company-lsp)
(push 'company-lsp company-backends)
(add-hook 'after-init-hook 'global-company-mode)

but if set debug-on-error to t, i got the following whenever pausing during typing (guess it's when company is called up). what's causing this problem?

Debugger entered--Lisp error: (void-function lsp--client-completion-in-comments\?)
  (lsp--client-completion-in-comments\? (progn (or (and (memq (type-of it) cl-struct-lsp--workspace-tags) t) (signal (quote wrong-type-argument) (list (quote lsp--workspace) it))) (aref it 6)))
  (setq needle (lsp--client-completion-in-comments\? (progn (or (and (memq (type-of it) cl-struct-lsp--workspace-tags) t) (signal (quote wrong-type-argument) (list (quote lsp--workspace) it))) (aref it 6))))
  (if (not (not needle)) (setq continue nil) (setq needle (lsp--client-completion-in-comments\? (progn (or (and (memq (type-of it) cl-struct-lsp--workspace-tags) t) (signal (quote wrong-type-argument) (list (quote lsp--workspace) it))) (aref it 6)))))
  (let ((it (car list))) (if (not (not needle)) (setq continue nil) (setq needle (lsp--client-completion-in-comments\? (progn (or (and (memq ... cl-struct-lsp--workspace-tags) t) (signal (quote wrong-type-argument) (list ... it))) (aref it 6))))))
  (while (and list continue) (let ((it (car list))) (if (not (not needle)) (setq continue nil) (setq needle (lsp--client-completion-in-comments\? (progn (or (and ... t) (signal ... ...)) (aref it 6)))))) (setq it-index (1+ it-index)) (setq list (cdr list)))
  (let ((list (lsp-workspaces)) (continue t) (it-index 0)) (while (and list continue) (let ((it (car list))) (if (not (not needle)) (setq continue nil) (setq needle (lsp--client-completion-in-comments\? (progn (or ... ...) (aref it 6)))))) (setq it-index (1+ it-index)) (setq list (cdr list))))
  (let (needle) (let ((list (lsp-workspaces)) (continue t) (it-index 0)) (while (and list continue) (let ((it (car list))) (if (not (not needle)) (setq continue nil) (setq needle (lsp--client-completion-in-comments\? (progn ... ...))))) (setq it-index (1+ it-index)) (setq list (cdr list)))) needle)
  (or (let (needle) (let ((list (lsp-workspaces)) (continue t) (it-index 0)) (while (and list continue) (let ((it (car list))) (if (not (not needle)) (setq continue nil) (setq needle (lsp--client-completion-in-comments\? ...)))) (setq it-index (1+ it-index)) (setq list (cdr list)))) needle) (not (company-in-string-or-comment)))
  (and (and (boundp (quote lsp-mode)) lsp-mode) (lsp--capability "completionProvider") (or (let (needle) (let ((list (lsp-workspaces)) (continue t) (it-index 0)) (while (and list continue) (let ((it ...)) (if (not ...) (setq continue nil) (setq needle ...))) (setq it-index (1+ it-index)) (setq list (cdr list)))) needle) (not (company-in-string-or-comment))) (or (company-lsp--completion-prefix) (quote stop)))
  (cond ((eql command (quote interactive)) (company-begin-backend (function company-lsp))) ((eql command (quote prefix)) (and (and (boundp (quote lsp-mode)) lsp-mode) (lsp--capability "completionProvider") (or (let (needle) (let ((list ...) (continue t) (it-index 0)) (while (and list continue) (let ... ...) (setq it-index ...) (setq list ...))) needle) (not (company-in-string-or-comment))) (or (company-lsp--completion-prefix) (quote stop)))) ((eql command (quote candidates)) (or (company-lsp--cache-item-candidates (company-lsp--cache-get arg)) (and company-lsp-async (cons :async (function (lambda (callback) (company-lsp--candidates-async arg callback))))) (company-lsp--candidates-sync arg))) ((eql command (quote sorted)) t) ((eql command (quote no-cache)) (not (eq company-lsp-cache-candidates t))) ((eql command (quote annotation)) (lsp--annotate arg)) ((eql command (quote quickhelp-string)) (company-lsp--documentation arg)) ((eql command (quote doc-buffer)) (company-doc-buffer (company-lsp--documentation arg))) ((eql command (quote match)) (cdr (company-lsp--compute-flex-match arg))) ((eql command (quote post-completion)) (company-lsp--post-completion arg)))
  company-lsp(prefix)
  apply(company-lsp prefix)
  (if (functionp company-backend) (apply company-backend args) (apply (function company--multi-backend-adapter) company-backend args))
  (condition-case err (if (functionp company-backend) (apply company-backend args) (apply (function company--multi-backend-adapter) company-backend args)) ((debug user-error) (user-error "Company: backend %s user-error: %s" company-backend (error-message-string err))) ((debug error) (error "Company: backend %s error \"%s\" with args %s" company-backend (error-message-string err) args)))
  company-call-backend-raw(prefix)
  apply(company-call-backend-raw prefix)
  (let ((value (apply fun args))) (if (not (eq (car-safe value) :async)) value (let ((res (quote trash)) (start (time-to-seconds))) (funcall (cdr value) (function (lambda (result) (setq res result)))) (while (eq res (quote trash)) (if (> (- (time-to-seconds) start) company-async-timeout) (error "Company: backend %s async timeout with args %s" backend args) (sleep-for company-async-wait))) res)))
  company--force-sync(company-call-backend-raw (prefix) company-lsp)
  company-call-backend(prefix)
  (let ((company-backend backend)) (company-call-backend (quote prefix)))
  (progn (let ((company-backend backend)) (company-call-backend (quote prefix))))
  (if (company--maybe-init-backend backend) (progn (let ((company-backend backend)) (company-call-backend (quote prefix)))))
  (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let ((company-backend backend)) (company-call-backend (quote prefix))))) (company--multi-backend-adapter backend (quote prefix)))
  (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let ((company-backend backend)) (company-call-backend (quote prefix))))) (company--multi-backend-adapter backend (quote prefix))))
  (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let ((company-backend backend)) (company-call-backend (quote prefix))))) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (let ((ignore-case ...)) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond (... ...) (... ...) (t ... ... ... ...))))) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let (...) (company-call-backend ...)))) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (let (...) (setq company-prefix ... company-backend backend c ...) (cond ... ... ...)))) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let ... ...))) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (let ... ... ...))) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (catch (quote --cl-block-nil--) (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn ...)) (company--multi-backend-adapter backend (quote prefix)))) (if prefix (progn (if (company--good-prefix-p prefix) (progn ...)) (throw (quote --cl-block-nil--) c))) (setq --dolist-tail-- (cdr --dolist-tail--))))))
  (let (prefix c) (catch (quote --cl-block-nil--) (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or ... ...) (if ... ...) (company--multi-backend-adapter backend ...))) (if prefix (progn (if ... ...) (throw ... c))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
  company--begin-new()
  (and (company--should-complete) (company--begin-new))
  (or (and company-candidates (company--continue)) (and (company--should-complete) (company--begin-new)))
  company--perform()
  (let ((inhibit-quit nil)) (company--perform) company-candidates)
  (condition-case err (let ((inhibit-quit nil)) (company--perform) company-candidates) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel)))
  (let ((company-idle-delay (quote now))) (condition-case err (let ((inhibit-quit nil)) (company--perform) company-candidates) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel))))
  (and company-mode (not company-candidates) (let ((company-idle-delay (quote now))) (condition-case err (let ((inhibit-quit nil)) (company--perform) company-candidates) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel)))))
  company-auto-begin()
  (if (company-auto-begin) (progn (company-input-noop) (let ((this-command (quote company-idle-begin))) (company-post-command))))
  (and (eq buf (current-buffer)) (eq win (selected-window)) (eq tick (buffer-chars-modified-tick)) (eq pos (point)) (if (company-auto-begin) (progn (company-input-noop) (let ((this-command (quote company-idle-begin))) (company-post-command)))))
  company-idle-begin(#<buffer api.py> #<window 3 on api.py> 3087 5740)
  apply(company-idle-begin (#<buffer api.py> #<window 3 on api.py> 3087 5740))
  timer-event-handler([t 23863 56381 505651 nil company-idle-begin (#<buffer api.py> #<window 3 on api.py> 3087 5740) nil 176000])

2 Answers 2

1

There is a mismatch between lsp-mode and company-lsp version. In order to fix that you may delete the packages located in ~/.emacs.d/elpa to force re-downloading them.

1

I ran into a similar problem with a similar setup; I also got the warning:

company-lsp is no longer supported, using company-capf

Just updating all my packages did not solve the problem, however removing:

(push 'company-lsp company-backends)

from my configuration fixed the error and idle completion works again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.