tigersoldier / company-lsp

Company completion backend for lsp-mode
GNU General Public License v3.0
251 stars 26 forks source link

Void functions `lsp--sort-completions` and `lsp--annotate` #145

Open tzoz opened 4 years ago

tzoz commented 4 years ago

It seems that updates to lsp-mode have changed the names of these functions. I worked around this issue by adding the following code to my init.el:

(defun lsp--sort-completions (completions)
  (lsp-completion--sort-completions completions))

(defun lsp--annotate (item)
  (lsp-completion--annotate item))

(defun lsp--resolve-completion (item)
  (lsp-completion--resolve item))

Though it would be better for a PR to use the new names instead.

yyoncho commented 4 years ago

Comapny-lsp is no longer supported. Delete that package and lsp-mode will pick company-capf.

tzoz commented 4 years ago

Is there a way to have asynchronous completions with company-capf?

yyoncho commented 4 years ago

it is async ootb.

yyoncho commented 4 years ago

I mean, the implementation does not block but it is not async.

tzoz commented 4 years ago

I tried with company-capf, and it did in fact block while waiting for completions. For large projects, this block can be for more than 10 seconds, which is unacceptable. If you can show how to prevent this, that would be helpful. I am still using company-lsp because it does exactly that.

yyoncho commented 4 years ago

company-capf does not block. Most likely something else is blocking. Please follow https://emacs-lsp.github.io/lsp-mode/page/performance/

bmourad01 commented 1 year ago

@yyoncho

company-capf does not block

This does not mirror my experience, see this issue: https://github.com/company-mode/company-mode/issues/1073 As soon as I do M-: (setq company-backends (remove 'company-capf company-backends)) I no longer have any blocking, and completions are working 100%.

Commenting out this line seems to resolve my problem: https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-completion.el#L774

I don't understand why company-lsp is not supported anymore, when it clearly supports asynchronous completions and company-capf doesn't. Am I doing something wrong?