Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tzoz opened this issue Aug 25, 2020 · 7 comments
Open

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

tzoz opened this issue Aug 25, 2020 · 7 comments

Comments

@tzoz
Copy link

tzoz commented Aug 25, 2020

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
Copy link
Contributor

yyoncho commented Aug 26, 2020

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

@tzoz
Copy link
Author

tzoz commented Aug 26, 2020

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

@yyoncho
Copy link
Contributor

yyoncho commented Aug 26, 2020

it is async ootb.

@yyoncho
Copy link
Contributor

yyoncho commented Aug 26, 2020

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

@tzoz
Copy link
Author

tzoz commented Aug 26, 2020

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
Copy link
Contributor

yyoncho commented Aug 27, 2020

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

jws85 pushed a commit to jws85/.emacs.d that referenced this issue Jan 14, 2021
Olzaq added a commit to Olzaq/emacs_config that referenced this issue Apr 29, 2021
Indy2222 added a commit to Indy2222/dotfiles that referenced this issue May 22, 2021
@bmourad01
Copy link

bmourad01 commented Nov 10, 2022

@yyoncho

company-capf does not block

This does not mirror my experience, see this issue: company-mode/company-mode#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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants