Minor edits.

This commit is contained in:
Derek Taylor
2020-11-05 13:27:52 -06:00
parent 8fbacc6392
commit 35112d3f8c
170 changed files with 1304 additions and 756 deletions

View File

@@ -7,7 +7,6 @@
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#hacks][Hacks]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#lsp-powered-project-search][LSP-powered project search]]
@@ -43,7 +42,7 @@ As of this writing, this is the state of LSP support in Doom Emacs:
| [[../../lang/elixir/README.org][:lang elixir]] | elixir-mode | elixir-ls |
| [[../../lang/fsharp/README.org][:lang fsharp]] | fsharp-mode | Mono, .NET core |
| [[../../lang/go/README.org][:lang go]] | go-mode | go-langserver |
| [[../../lang/haskell/README.org][:lang haskell]] | haskell-mode | haskell-ide-engine |
| [[../../lang/haskell/README.org][:lang haskell]] | haskell-mode | haskell-language-server |
| [[../../lang/java/README.org][:lang java]] | java-mode | lsp-java |
| [[../../lang/javascript/README.org][:lang javascript]] | js2-mode, rjsx-mode, typescript-mode | typescript-language-server |
| [[../../lang/ocaml/README.org][:lang ocaml]] | tuareg-mode | ocaml-language-server |
@@ -70,23 +69,17 @@ As of this writing, this is the state of LSP support in Doom Emacs:
+ [[https://github.com/emacs-lsp/helm-lsp][helm-lsp]]
+ [[https://github.com/joaotavora/eglot][eglot]]
** Hacks
+ ~lsp-mode~ has been modified not to automatically install missing LSP servers.
This is done to adhere to our "Your system, your rules" mantra, which insist
that it is better etiquette to let the user decide when their development
environment is modified. Use ~M-x lsp-install-server~ to install LSP servers
manually.
* Prerequisites
This module has no direct prerequisites, but major-modes require you to install
language servers.
This module has no direct prerequisites, but different languages will need
different language servers, which =lsp-mode= will prompt you to auto-install.
=eglot= will not.
You'll find a table that lists available language servers and how to install
them [[https://github.com/emacs-lsp/lsp-mode#supported-languages][in the lsp-mode project README]]. The documentation of the module for your
A table that lists available language servers and how to install them can be
found [[https://emacs-lsp.github.io/lsp-mode/page/languages/][on the lsp-mode project README]]. The documentation of the module for your
targeted language will contain brief instructions as well.
For eglot users, you can see the list of [[https://github.com/joaotavora/eglot/blob/master/README.md#connecting-to-a-server][default servers supported in the README]].
There is also instructions to add another server easily.
For eglot users, a list of [[https://github.com/joaotavora/eglot/blob/master/README.md#connecting-to-a-server][default servers supported is on Eglot's README]],
including instructions to register your own.
* TODO Features
** LSP-powered project search

View File

@@ -12,19 +12,39 @@ killing and opening many LSP/eglot-powered buffers.")
;;
;;; Common
(defun +lsp-init-optimizations-h ()
"Deploys universal optimizations for `lsp-mode' and `eglot'."
(when (or (bound-and-true-p eglot--managed-mode)
(bound-and-true-p lsp-mode))
;; `read-process-output-max' is only available on recent development
;; builds of Emacs 27 and above.
(setq-local 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.
(setq-local gcmh-high-cons-threshold (* 2 (default-value 'gcmh-high-cons-threshold)))))
(defvar +lsp--default-read-process-output-max nil)
(defvar +lsp--default-gcmh-high-cons-threshold nil)
(defvar +lsp--optimization-init-p nil)
(define-minor-mode +lsp-optimization-mode
"Deploys universal GC and IPC optimizations for `lsp-mode' and `eglot'."
:global t
:init-value nil
(if (not +lsp-optimization-mode)
(setq-default read-process-output-max +lsp--default-read-process-output-max
gcmh-high-cons-threshold +lsp--default-gcmh-high-cons-threshold
+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-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.
(setq-default gcmh-high-cons-threshold (* 2 +lsp--default-gcmh-high-cons-threshold))
(unless (bound-and-true-p gcmh-mode)
(gcmh-mode +1))
(gcmh-set-high-threshold)
(setq +lsp--optimization-init-p t))))
;;

View File

@@ -3,11 +3,11 @@
(if (featurep! +eglot)
(progn
(package! eglot :pin "5f873d288e1c5434c1640bef03555ed056cb0d35")
(package! eglot :pin "61b71ea769fa14887465517f70832861f7052816")
(package! project :pin "da0333a697b18f0a863c1b1523d2fc7991b31174"))
(package! lsp-mode :pin "4145a70ce1d4bfb2463606ba34c5965080b080d9")
(package! lsp-ui :pin "c39ae3713f95a2d86e11fd1f77e89a671d08d18a")
(package! lsp-mode :pin "fb4c35c6978415c4cf52f85230b527d311989063")
(package! lsp-ui :pin "25552041f5af110c282fe8a2c714dec0f7a2320e")
(when (featurep! :completion ivy)
(package! lsp-ivy :pin "4cdb739fc2bc47f7d4dcad824f9240c70c4cb37d"))
(package! lsp-ivy :pin "20cac6296e5038b7131ee6f34a96635f1d30fe3c"))
(when (featurep! :completion helm)
(package! helm-lsp :pin "4263c967267b0579956b3b12ef32878a9ea80d97")))
(package! helm-lsp :pin "fc09aa0903ee6abe4955e9a6062dcea667ebff5a")))