Fix autocompletion of file names in js2-mode when lsp is used
Do transformation only when completions are returned by lsp.
This commit is contained in:
parent
0f1c461a5c
commit
50eda6a897
1 changed files with 4 additions and 1 deletions
|
@ -43,7 +43,10 @@ https://github.com/emacs-lsp/lsp-javascript/issues/9#issuecomment-379515379"
|
|||
(interactive)
|
||||
(defun lsp-prefix-company-transformer (candidates)
|
||||
(let ((completion-ignore-case t))
|
||||
(all-completions (company-grab-symbol) candidates)))
|
||||
(if (and (car candidates)
|
||||
(get-text-property 0 'lsp-completion-prefix (car candidates)))
|
||||
(all-completions (company-grab-symbol) candidates)
|
||||
candidates)))
|
||||
(make-local-variable 'company-transformers)
|
||||
(add-to-list 'company-transformers 'lsp-prefix-company-transformer))
|
||||
|
||||
|
|
Reference in a new issue