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

@@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; tools/ansible/packages.el
(package! ansible :recipe (:nonrecursive t) :pin "b5ef59406604bc5027f4d816d90e633feef0149c")
(package! ansible :recipe (:nonrecursive t) :pin "cf6b8f06c2628357fc2a72ea9817a2c2d0ebf690")
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
(package! jinja2-mode :pin "ecd19a40b7832bb00f0a2244e3b0713d0bf3850d")
(package! yaml-mode :pin "68fecb5f0dec712a10c8655df6881392a4613617")

View File

@@ -24,7 +24,7 @@
((:lang php +lsp) :after php-mode :require dap-php)
((:lang python +lsp) :after python :require dap-python)
((:lang ruby +lsp) :after ruby-mode :require dap-ruby)
((:lang rust +lsp) :after rust-mode :require dap-lldb)
((:lang rust +lsp) :after rustic-mode :require dap-lldb)
((:lang javascript +lsp)
:after (js2-mode typescript-mode)
:require (dap-node dap-chrome dap-firefox ,@(if IS-WINDOWS '(dap-edge)))))
@@ -105,11 +105,10 @@
(use-package! dap-mode
:when (and (featurep! +lsp) (not (featurep! :tools lsp +eglot)))
:hook (dap-mode . dap-tooltip-mode)
:after lsp-mode
:demand t
:preface
:init
(setq dap-breakpoints-file (concat doom-etc-dir "dap-breakpoints")
dap-utils-extension-path (concat doom-etc-dir "dap-extension/"))
(after! lsp-mode (require 'dap-mode))
:config
(pcase-dolist (`((,category . ,modules) :after ,after :require ,libs)
+debugger--dap-alist)

View File

@@ -1,10 +1,10 @@
;; -*- no-byte-compile: t; -*-
;;; tools/debugger/packages.el
(when (package! realgud :pin "332d13673074bee252ae7819b0898ee7c7895d2e")
(when (package! realgud :pin "ff660011c82c6af504915833e2d981a547b7ad58")
(when (featurep! :lang javascript)
(package! realgud-trepan-ni :pin "6e38cf838c7b47b5f1353d00901b939ffa36d707")))
(when (featurep! +lsp)
(package! dap-mode :pin "4b185431b2b0cdec86ecfbc679f45d21fbf9fe59")
(package! posframe :pin "7b92a54e588889a74d36d51167e067676db7be8a"))
(package! dap-mode :pin "400ec52d32adc7dc0d736dc42ed1bacb8fd7ae14")
(package! posframe :pin "a99da9f40fa864910fd0234bb9e1b6fa52e699c3"))

View File

@@ -53,8 +53,10 @@ brew install direnv
#+END_SRC
** Arch Linux
~direnv~ is available on the AUR
#+BEGIN_SRC bash
sudo pacman -S direnv
yay -S direnv
#+END_SRC
** NixOS

View File

@@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; tools/direnv/packages.el
(package! envrc :pin "1dc5aad14d2c27211c7c288d2d9dffeb2e27cb2d")
(package! envrc :pin "da8e306b0a562af05c5e990aced968d7fda06296")

View File

@@ -3,4 +3,4 @@
(package! editorconfig
:recipe (:nonrecursive t)
:pin "9bc1343ce8bd2cc84bf04b58a053b7ec700244c0")
:pin "a6c70da2cf3a3a2aac2b204828f1acd243cd7529")

View File

@@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; tools/ein/packages.el
(package! ein :pin "99a4718f50538a439a2a3f2011d1aa97246e259b")
(package! ein :pin "1bfb80c8bbe4ace10c4b430c493149efa4aabbbd")

View File

@@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; tools/eval/packages.el
(package! quickrun :pin "ce7383c53215077f7e1d258d389cf8731309fbe9")
(package! quickrun :pin "005d269ce5080a127b44e0d29efe2f2e9852d0cc")
(when (featurep! +overlay)
(package! eros :pin "dd8910279226259e100dab798b073a52f9b4233a"))

View File

@@ -180,6 +180,7 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
;;
;;; Lookup backends
(autoload 'xref--show-defs "xref")
(defun +lookup--xref-show (fn identifier &optional show-fn)
(let ((xrefs (funcall fn
(xref-find-backend)
@@ -239,14 +240,39 @@ neither is available. These require ripgrep to be installed."
(defun +lookup-evil-goto-definition-backend-fn (_identifier)
"Uses `evil-goto-definition' to conduct a text search for IDENTIFIER in the
current buffer."
(and (fboundp 'evil-goto-definition)
(ignore-errors
(cl-destructuring-bind (beg . end)
(bounds-of-thing-at-point 'symbol)
(evil-goto-definition)
(let ((pt (point)))
(not (and (>= pt beg)
(< pt end))))))))
(when (fboundp 'evil-goto-definition)
(ignore-errors
(cl-destructuring-bind (beg . end)
(bounds-of-thing-at-point 'symbol)
(evil-goto-definition)
(let ((pt (point)))
(not (and (>= pt beg)
(< pt end))))))))
(defun +lookup-ffap-backend-fn (_identifier)
"Uses `find-file-at-point' to read file at point."
(require 'ffap)
(when (ffap-guesser)
(find-file-at-point)))
(defun +lookup-bug-reference-backend-fn (_identifier)
"Searches for a bug reference in user/repo#123 or #123 format and opens it in
the browser."
(require 'bug-reference)
(let ((bug-reference-url-format bug-reference-url-format)
(bug-reference-bug-regexp bug-reference-bug-regexp)
(bug-reference-mode (derived-mode-p 'text-mode 'conf-mode))
(bug-reference-prog-mode (derived-mode-p 'prog-mode)))
(bug-reference--run-auto-setup)
(unwind-protect
(catch 'found
(bug-reference-fontify (line-beginning-position) (line-end-position))
(dolist (o (overlays-at (point)))
;; It should only be possible to have one URL overlay.
(when-let (url (overlay-get o 'bug-reference-url))
(browse-url url)
(throw 'found t))))
(bug-reference-unfontify (line-beginning-position) (line-end-position)))))
;;
@@ -317,22 +343,14 @@ for the current mode/buffer (if any), then falls back to the backends in
(defvar ffap-file-finder)
;;;###autoload
(defun +lookup/file (path)
(defun +lookup/file (&optional path)
"Figure out PATH from whatever is at point and open it.
Each function in `+lookup-file-functions' is tried until one changes the point
or the current buffer.
Otherwise, falls back on `find-file-at-point'."
(interactive
(progn
(require 'ffap)
(list
(or (ffap-guesser)
(ffap-read-file-or-url
(if ffap-url-regexp "Find file or URL: " "Find file: ")
(doom-thing-at-point-or-region))))))
(require 'ffap)
(interactive)
(cond ((and path
buffer-file-name
(file-equal-p path buffer-file-name)

View File

@@ -97,7 +97,9 @@ If the argument is interactive (satisfies `commandp'), it is called with
argument: the identifier at point. See `set-lookup-handlers!' about adding to
this list.")
(defvar +lookup-file-functions ()
(defvar +lookup-file-functions
'(+lookup-ffap-backend-fn
+lookup-bug-reference-backend-fn)
"Function for `+lookup/file' to try, before restoring to `find-file-at-point'.
Stops at the first function to return non-nil or change the current
window/point.
@@ -153,8 +155,10 @@ Dictionary.app behind the scenes to get definitions.")
(let ((xref-backend-functions '(etags--xref-backend t)))
(funcall orig-fn)))
;; Use `better-jumper' instead of xref's marker stack
(advice-add #'xref-push-marker-stack :around #'doom-set-jump-a)
;; This integration is already built into evil
(unless (featurep! :editor evil)
;; Use `better-jumper' instead of xref's marker stack
(advice-add #'xref-push-marker-stack :around #'doom-set-jump-a))
(use-package! ivy-xref
:when (featurep! :completion ivy)

View File

@@ -8,11 +8,11 @@
(package! helm))
;;
(package! dumb-jump :pin "0d74b2f2aa834b602e91d99e9cb23197a389f042")
(package! dumb-jump :pin "fbbe6b0c3010bea8a6eaac2297080137319160e2")
(when (featurep! :completion ivy)
(package! ivy-xref :pin "3d4c35fe2b243d948d8fe02a1f0d76a249d63de9"))
(when (featurep! :completion helm)
(package! helm-xref :pin "6b4a8bd91f5eaf82f51bd31b03f6587387fe6983"))
(package! helm-xref :pin "23f1174cfca7667d95828dcd388c655a4a9c877d"))
;; For dictionary and online lookup
(package! request :pin "d02d1347ffdf138cffd380cbeac62ac8732036ef")
@@ -27,7 +27,7 @@
(when (featurep! +dictionary)
(if IS-MAC
(package! osx-dictionary :pin "1b79ff64c72485cb078db9ab7ee3256b11a99f4b")
(package! define-word :pin "08c71b1ff4fd07bf0c78d1fcf77efeaafc8f7443")
(package! define-word :pin "3af6825c5f3bf4f6176a3f5b2e499616c65e2fe0")
(package! powerthesaurus :pin "93036d3b111925ebc34f747ff846cb0b8669b92e")
(when (featurep! +offline)
(package! wordnut :pin "feac531404041855312c1a046bde7ea18c674915")

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

View File

@@ -66,7 +66,8 @@ window that already exists in that direction. It will split otherwise."
+magit-open-windows-in-direction))
(origin-window (selected-window)))
(if-let (window (window-in-direction direction))
(select-window window)
(unless magit-display-buffer-noselect
(select-window window))
(if-let (window (and (not (one-window-p))
(window-in-direction
(pcase direction
@@ -74,16 +75,19 @@ window that already exists in that direction. It will split otherwise."
(`left 'right)
((or `up `above) 'down)
((or `down `below) 'up)))))
(select-window window)
(unless magit-display-buffer-noselect
(select-window window))
(let ((window (split-window nil nil direction)))
(when (memq direction '(right down below))
(when (and (not magit-display-buffer-noselect)
(memq direction '(right down below)))
(select-window window))
(display-buffer-record-window 'reuse window buffer)
(set-window-buffer window buffer)
(set-window-parameter window 'quit-restore (list 'window 'window origin-window buffer))
(set-window-prev-buffers window nil))))
(switch-to-buffer buffer t t)
(selected-window)))
(unless magit-display-buffer-noselect
(switch-to-buffer buffer t t)
(selected-window))))
;;

View File

@@ -112,7 +112,7 @@ For example, diffs and log buffers. Accepts `left', `right', `up', and `down'.")
;; git executable isn't in the exact same location.
(add-hook! 'magit-status-mode-hook
(defun +magit-optimize-process-calls-h ()
(when-let (path (executable-find magit-git-executable))
(when-let (path (executable-find magit-git-executable t))
(setq-local magit-git-executable path)))))

View File

@@ -1,11 +1,11 @@
;; -*- no-byte-compile: t; -*-
;;; tools/magit/packages.el
(when (package! magit :pin "321214c3a2dd10fdf672ba96bd00703a51094bbe")
(when (package! magit :pin "2fb3bf782ccf5652b98f8de989f014749473eacf")
(when (featurep! +forge)
(package! forge :pin "feee7e2fce3f87f7aa113c5edcb1896127ee9d12"))
(package! forge :pin "031e4f06b2bff66375e53ea96f8eb3dfbdf391d9"))
(package! magit-gitflow :pin "cc41b561ec6eea947fe9a176349fb4f771ed865b")
(package! magit-todos :pin "a0e5d1f3c7dfcb4f18c1b0d57f1746a4872df5c6")
(package! github-review :pin "fab440aeae4fbf6a8192fd11795052e9eb5d27d1")
(package! github-review :pin "e2123cce391bfd9d947ba2934b5d655ab1e90b6d")
(when (featurep! :editor evil +everywhere)
(package! evil-magit :pin "88dc26ce59dbf4acb4e2891c79c4bd329553ba56")))

View File

@@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; tools/upload/packages.el
(package! ssh-deploy :pin "1bb2f821d4a78d483c147759348a29531486cdc4")
(package! ssh-deploy :pin "cc91b56a7f07ae63fcf78a040001491d040ec9ba")