all repos — archive/dotfiles @ 69fd821f9d2b808322b5caf3001ce6333a1e4990

Superseded by nixfiles

Emacs: fix company-tabnine/lsp interaction
Alan Pearce alan@alanpearce.eu
Thu, 04 Jul 2019 16:57:15 +0200
commit

69fd821f9d2b808322b5caf3001ce6333a1e4990

parent

598f3659971e4829f2f4b61d4a07b0c930ce022f

1 files changed, 11 insertions(+), 0 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -323,10 +323,13 @@ (use-package all-the-icons)
 
 (use-package company-tabnine
+  :after (company-lsp)
   :commands (company-tabnine)
   :general ("<M-tab>" #'company-tabnine-call-other-backends
             "<C-tab>" #'company-tabnine-call-other-backends)
   :config (progn
+            (if (fboundp #'company-lsp)
+                (add-to-list 'company-backends #'company-lsp))
             (add-to-list 'company-backends #'company-tabnine)))
 
 ;;; Documentation
@@ -510,15 +513,23 @@ (use-package flymake   :custom ((flymake-error-bitmap '(left-vertical-bar compilation-error))
            (flymake-warning-bitmap '(left-vertical-bar compilation-warning))))
 
+(use-package company-lsp
+  :commands (company-lsp))
 (use-package lsp-mode
   :ghook ('(typescript-mode-hook
             js-mode-hook)
           #'lsp)
+  :functions (lsp--flymake-setup)
+  :gfhook 'lsp--flymake-setup
   :custom ((lsp-auto-guess-root t)
+           (lsp-auto-configure nil)
            (lsp-prefer-flymake t)
            (lsp-enable-symbol-highlighting nil))
   :config (progn
             (add-to-list 'lsp-language-id-configuration '(js-mode . "javascript"))))
+
+(use-package lsp-clients
+  :after (lsp-mode))
 
 (use-package lsp-ui
   :after lsp-mode