From 993e773414968a8878448511c58b4cc993b9eaa1 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 8 Sep 2023 11:55:56 -0400 Subject: [PATCH] Disable logging of LSP traffic. --- ansible/roles/emacs/files/early-init.el | 25 +++++++++++++++++++ ansible/roles/emacs/files/elisp/base.el | 9 ------- ansible/roles/emacs/files/elisp/common-lsp.el | 24 +++++++----------- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/ansible/roles/emacs/files/early-init.el b/ansible/roles/emacs/files/early-init.el index e69de29..ae8a347 100644 --- a/ansible/roles/emacs/files/early-init.el +++ b/ansible/roles/emacs/files/early-init.el @@ -0,0 +1,25 @@ +(setq gc-cons-threshold 100000000) ;; Increase garbage collection threshold for performance (default 800000) +;; Increase amount of data read from processes, default 4k +(when (>= emacs-major-version 27) + (setq read-process-output-max (* 1024 1024)) ;; 1mb + ) + +;; Suppress warnings +(setq byte-compile-warnings '(not obsolete)) +(setq warning-suppress-log-types '((comp) (bytecomp))) +(setq native-comp-async-report-warnings-errors 'silent) + +;; Set up default visual settings +(setq frame-resize-pixelwise t) +;; Disable toolbar & menubar +(menu-bar-mode -1) +(when (fboundp 'tool-bar-mode) + (tool-bar-mode -1)) +(when (display-graphic-p) + (context-menu-mode +1)) + +(setq default-frame-alist '((fullscreen . maximized) + (vertical-scroll-bars . nil) + (horizontal-scroll-bars . nil) + ;; Set dark colors in early-init to prevent flashes of white. + (background-color . "#000000"))) diff --git a/ansible/roles/emacs/files/elisp/base.el b/ansible/roles/emacs/files/elisp/base.el index 743db2f..58d54a5 100644 --- a/ansible/roles/emacs/files/elisp/base.el +++ b/ansible/roles/emacs/files/elisp/base.el @@ -85,15 +85,6 @@ backup-directory-alist `((".*" . ,(concat temp-dir "/backup/"))) auto-save-file-name-transforms `((".*" ,(concat temp-dir "/auto-save-list/") t))) -;; Disable toolbar & menubar -(menu-bar-mode -1) -(when (fboundp 'tool-bar-mode) - (tool-bar-mode -1)) -(when ( fboundp 'scroll-bar-mode) - (scroll-bar-mode -1)) - -(context-menu-mode +1) - ;; Delete trailing whitespace before save (add-hook 'before-save-hook 'delete-trailing-whitespace) diff --git a/ansible/roles/emacs/files/elisp/common-lsp.el b/ansible/roles/emacs/files/elisp/common-lsp.el index 9a1e550..40ad135 100644 --- a/ansible/roles/emacs/files/elisp/common-lsp.el +++ b/ansible/roles/emacs/files/elisp/common-lsp.el @@ -7,6 +7,8 @@ ;; M-? ;; ([remap xref-find-references] . lsp-ui-peek-find-references) ("C-c C-a" . eglot-code-actions) + ;; C-M-. + ([remap xref-find-apropos] . #'consult-eglot-symbols) ) :hook ( (eglot-managed-mode . (lambda () @@ -16,27 +18,19 @@ )) ) :config - ;; Increase garbage collection threshold for performance (default 800000) - (setq gc-cons-threshold 100000000) - - ;; Increase amount of data read from processes, default 4k - (when (>= emacs-major-version 27) - (setq read-process-output-max (* 1024 1024)) ;; 1mb - ) - + (fset #'jsonrpc--log-event #'ignore) ;; Disable logging LSP traffic for performance boost (set-face-attribute 'eglot-highlight-symbol-face nil :background "#0291a1" :foreground "black") (set-face-attribute 'eglot-mode-line nil :inherit 'mode-line :bold nil) - (use-package consult-eglot - :bind ( - :map eglot-mode-map - ;; C-M-. - ([remap xref-find-apropos] . #'consult-eglot-symbols) - ) - ) + :custom (eglot-autoshutdown t "Shut down server when last buffer is killed.") (eglot-sync-connect 0 "Don't block on language server starting.") + (eglot-send-changes-idle-time 0.1) + ) + +(use-package consult-eglot + :commands (consult-eglot-symbols) ) (provide 'common-lsp)