SLY: Re-enable company completion.

Seems better overall, just need to make sure we don't miss symbols.
master
Pierre Neidhardt 2021-06-07 12:46:58 +02:00
parent 8517e1c7e5
commit c4ee4c1456
1 changed files with 17 additions and 13 deletions

View File

@ -237,25 +237,29 @@ Good substitute for `sly-mrepl-indent-and-complete-symbol'."
(when (require 'helm-sly nil 'noerror)
(add-hook 'sly-mrepl-hook #'helm-sly-disable-internal-completion)
;; REVIEW: Company completion has the benefit of having annotations.
;; (when (require 'helm-company nil :noerror)
;; (add-hook 'lisp-mode-hook #'company-mode)
;; (define-key lisp-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
;; (define-key lisp-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company)
;; (defun ambrevar/sly-set-keys ()
;; (define-key sly-mrepl-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
;; (define-key sly-mrepl-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company))
;; (add-hook 'sly-mrepl-hook #'ambrevar/sly-set-keys)
;; (add-hook 'sly-mrepl-hook #'company-mode))
)
;; Cons of internal completion vs. company completion.
(when (require 'helm-company nil :noerror)
(setq helm-company-initialize-pattern-with-prefix t)
(add-hook 'lisp-mode-hook #'company-mode)
(define-key lisp-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
(define-key lisp-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company)
(defun ambrevar/sly-set-keys ()
(define-key sly-mrepl-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
(define-key sly-mrepl-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company))
(add-hook 'sly-mrepl-hook #'ambrevar/sly-set-keys)
(add-hook 'sly-mrepl-hook #'company-mode)))
;; Pros and cons of internal completion vs. company completion.
;; Cons:
;; - Internal does not support spaces like Helm does.
;; - Word order matters.
;; - Cannot complete against current package.
;; - [ ] File completion does not work.
;; Pros:
;; - Current suffix is included.
;; - [X] Current prefix is included in completion input.
;; Fix: (setq helm-company-initialize-pattern-with-prefix t)
;; - Less config.
;; - Company seem to miss some symbols?
;; Problem with cache?
;; https://github.com/joaotavora/sly/issues/328
(when (require 'helm-selector nil :noerror)
(require 'init-sly-selector))