From 510e3f744382b563c2968745ef644f35b1f98e2d Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Fri, 1 Feb 2019 15:16:06 +0200 Subject: [PATCH] Add LanguageServerProtocol mode --- 05prog-mode.el | 1 + 06company-yasnippet.el | 6 ++++++ init.el | 7 +++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/05prog-mode.el b/05prog-mode.el index 14646e7..a87e8f3 100644 --- a/05prog-mode.el +++ b/05prog-mode.el @@ -28,6 +28,7 @@ ;;; Show hex colors as colors (add-hook 'prog-mode-hook 'rainbow-mode) (add-hook 'text-mode-hook 'rainbow-mode) +(require 'lsp-mode) ;;; When pasting/writing over a selection, replace it. (delete-selection-mode 1) diff --git a/06company-yasnippet.el b/06company-yasnippet.el index 0044774..90eb41a 100644 --- a/06company-yasnippet.el +++ b/06company-yasnippet.el @@ -29,6 +29,7 @@ company-yasnippet ;; Snippets for all programming languages company-elisp ; Emacs Lisp company-clang company-cmake ;; C + company-lsp ;; Language server protocol company-robe ;; Ruby company-ansible ;; Ansible alchemist-company ;; Elixir @@ -38,6 +39,11 @@ company-files ; files & directory )) + +(setq-default company-lsp-cache-candidates 1 ;; Cache LSP results + company-lsp-async 1 ;; Fetch LSP results asynchronously + ) + ;;; Yasnippet configuration (define-key prog-mode-map (kbd "C-c y") 'company-yasnippet) (define-key prog-mode-map (kbd "") 'company-yasnippet) diff --git a/init.el b/init.el index 89fe66a..701febc 100644 --- a/init.el +++ b/init.el @@ -39,7 +39,10 @@ yasnippet-snippets ;; Actual snippets for various languages flycheck ;; Compilation framework visual-regexp ;; Regexp replacement with preview in - ;; current buffer. + ;; current buffer. + lsp-mode + company-lsp + lsp-ui ;; Project management projectile @@ -116,7 +119,7 @@ ;; If there is more than one, they won't work right. '(package-selected-packages (quote - (nginx-mode gitignore-mode js2-mode keyfreq company-web visual-regexp enh-ruby-mode counsel-projectile counsel ivy flycheck-rust flycheck racer rust-mode hydra markdown-mode solarized-theme company-ansible alchemist window-purpose column-enforce-mode yaml-mode ansible dockerfile-mode ruby-end web-mode rvm dash-at-point robe base16-theme exec-path-from-shell)))) + (dap-mode lsp-ui company-lsp lsp-mode nginx-mode gitignore-mode js2-mode keyfreq company-web visual-regexp enh-ruby-mode counsel-projectile counsel ivy flycheck-rust flycheck racer rust-mode hydra markdown-mode solarized-theme company-ansible alchemist window-purpose column-enforce-mode yaml-mode ansible dockerfile-mode ruby-end web-mode rvm dash-at-point robe base16-theme exec-path-from-shell)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful.