From 258104f750fca0920850db8d6c9607ee7d81d846 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Wed, 4 May 2022 19:46:28 +0300 Subject: [PATCH] refactor(lsp): remove emacs 26 workarounds --- modules/tools/lsp/config.el | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/modules/tools/lsp/config.el b/modules/tools/lsp/config.el index c09e1c050..896cbc9cc 100644 --- a/modules/tools/lsp/config.el +++ b/modules/tools/lsp/config.el @@ -26,20 +26,14 @@ killing and opening many LSP/eglot-powered buffers.") +lsp--optimization-init-p nil) ;; Only apply these settings once! (unless +lsp--optimization-init-p - (setq +lsp--default-read-process-output-max - ;; DEPRECATED Remove check when 26 support is dropped - (if (boundp 'read-process-output-max) - (default-value 'read-process-output-max)) - +lsp--default-gcmh-high-cons-threshold - (default-value 'gcmh-high-cons-threshold)) - ;; `read-process-output-max' is only available on recent development - ;; builds of Emacs 27 and above. + (setq +lsp--default-read-process-output-max (default-value 'read-process-output-max) + +lsp--default-gcmh-high-cons-threshold (default-value 'gcmh-high-cons-threshold)) (setq-default read-process-output-max (* 1024 1024)) - ;; REVIEW LSP causes a lot of allocations, with or without Emacs 27+'s - ;; native JSON library, so we up the GC threshold to stave off - ;; GC-induced slowdowns/freezes. Doom uses `gcmh' to enforce its - ;; GC strategy, so we modify its variables rather than - ;; `gc-cons-threshold' directly. + ;; REVIEW LSP causes a lot of allocations, with or without the native JSON + ;; library, so we up the GC threshold to stave off GC-induced + ;; slowdowns/freezes. Doom uses `gcmh' to enforce its GC strategy, + ;; so we modify its variables rather than `gc-cons-threshold' + ;; directly. (setq-default gcmh-high-cons-threshold (* 2 +lsp--default-gcmh-high-cons-threshold)) (gcmh-set-high-threshold) (setq +lsp--optimization-init-p t))))