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

Don't use orderless with company-capf as a default #16302

Open
niontrix opened this issue Mar 5, 2024 · 0 comments
Open

Don't use orderless with company-capf as a default #16302

niontrix opened this issue Mar 5, 2024 · 0 comments

Comments

@niontrix
Copy link
Contributor

niontrix commented Mar 5, 2024

Hi guys!
I recently switched from using helm to the compleseus-layer which uses orderless for completion styles. So far it works great.
But a few days ago I noticed that Company still seems to have an unresolved issue that causes the auto-completion to become unbearably slow when using ordereless as a completion style.
Currently the compleseus-layer configures orderless to not be used as a completion style when lsp-completion-mode is active, because as far as I know lsp provides its own completion styles, so its not needed.
The problem I have is that when I try to use auto-completion in an emacs-lisp buffer the auto-completion gets unuseably slow, which I could trace back to the use of orderless, using the profiler.
Like in oantolin/orderless#48 (comment) I think it maybe best not to use orderless as a completion style with company-capf by default, because it seems to be a general issue with company when using orderless, so I expect it to cause the same problems in other modes as well.

(defun compleseus/init-orderless ()
(use-package orderless
:init
;; company-capf is messed up with orderless
;; https://github.com/oantolin/orderless/issues/48#issuecomment-856750410
(define-advice company-capf (:around (orig-fun &rest args) set-completion-styles)
;; when lsp is on stay away
(if (bound-and-true-p lsp-completion-mode)
(apply orig-fun args)
(let ((completion-styles '(basic partial-completion orderless)))
(apply orig-fun args))))

Proposed:

 (defun compleseus/init-orderless () 
   (use-package orderless 
     :init 
     ;; company-capf is messed up with orderless 
     ;; https://github.com/oantolin/orderless/issues/48#issuecomment-856750410 
     (define-advice company-capf (:around (orig-fun &rest args) set-completion-styles) 
       (let ((completion-styles '(basic partial-completion orderless))) 
         (apply orig-fun args)))
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

1 participant