From efd0b421e34f93cab1b990123930c1dc9877a712 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 4 Jul 2020 18:52:33 +0100 Subject: [PATCH] feat(lsp): Improve lsp-mode performance, support latest 7.x version company-lsp is no longer supported by lsp-mode for providing completions to company, instead company-capf should be used which it built-in to company itself. --- core/siren-core-modules.el | 1 - core/siren-core-performance.el | 2 +- modules/lsp/siren-company-lsp.el | 16 ---------------- modules/lsp/siren-lsp.el | 12 +++++++++++- 4 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 modules/lsp/siren-company-lsp.el diff --git a/core/siren-core-modules.el b/core/siren-core-modules.el index 1b62e72..0a2a7dd 100644 --- a/core/siren-core-modules.el +++ b/core/siren-core-modules.el @@ -73,7 +73,6 @@ ;; Language Servers (require 'siren-lsp) (require 'siren-lsp-ui) -(require 'siren-company-lsp) (require 'siren-helm-lsp) ;; Shell diff --git a/core/siren-core-performance.el b/core/siren-core-performance.el index f0de02e..65cb432 100644 --- a/core/siren-core-performance.el +++ b/core/siren-core-performance.el @@ -14,7 +14,7 @@ :custom (gcmh-idle-delay 10) - (gcmh-high-cons-threshold 16777216)) + (gcmh-high-cons-threshold 104857600)) (provide 'siren-core-performance) ;;; siren-core-performance.el ends here diff --git a/modules/lsp/siren-company-lsp.el b/modules/lsp/siren-company-lsp.el deleted file mode 100644 index eafdd8a..0000000 --- a/modules/lsp/siren-company-lsp.el +++ /dev/null @@ -1,16 +0,0 @@ -;;; siren-company-lsp.el --- jimeh's Emacs Siren: company-lsp configuration. - -;;; Commentary: - -;; Basic configuration for company-lsp. - -;;; Code: - -(require 'siren-company) -(require 'siren-lsp) - -(use-package company-lsp - :defer t) - -(provide 'siren-company-lsp) -;;; siren-company-lsp.el ends here diff --git a/modules/lsp/siren-lsp.el b/modules/lsp/siren-lsp.el index 216af86..820ed8e 100644 --- a/modules/lsp/siren-lsp.el +++ b/modules/lsp/siren-lsp.el @@ -16,8 +16,18 @@ (lsp-mode . siren-lsp-mode-setup) :custom - (lsp-keymap-prefix "M-;") (lsp-eldoc-render-all nil) + (lsp-enable-xref t) + (lsp-enable-file-watchers t) + (lsp-enable-imenu t) + (lsp-keymap-prefix "M-;") + (lsp-prefer-capf t) + + ;; Set read process output to 1MB, instead of default 4KB. As many language + ;; servers produce output ranging from 800KB to 3MB, leaving it at 4KB affects + ;; performance. More info here: + ;; https://emacs-lsp.github.io/lsp-mode/page/performance/ + (read-process-output-max (* 1024 1024)) :init (defun siren-lsp-mode-setup ()