refactor(lsp): remove emacs 26 workarounds

This commit is contained in:
Itai Y. Efrat 2022-05-04 19:46:28 +03:00 committed by Henrik Lissner
parent 64b0e42260
commit 258104f750

View file

@ -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))))