[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 179a56d 13/54: Only set eglot--cached-current-ser
From: |
João Távora |
Subject: |
[elpa] externals/eglot 179a56d 13/54: Only set eglot--cached-current-server by (more aggressive) caching |
Date: |
Thu, 16 Apr 2020 05:31:46 -0400 (EDT) |
branch: externals/eglot
commit 179a56d75f544ebedf581edc03149f12fd2ba7a1
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>
Only set eglot--cached-current-server by (more aggressive) caching
* eglot.el (eglot--current-server): Always set cache value.
(eglot--maybe-activate-editing-mode): No need to set cached server.
---
eglot.el | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/eglot.el b/eglot.el
index e304ebd..a0f57f4 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1277,13 +1277,15 @@ For example, to keep your Company customization use
"A cached reference to the current EGLOT server.")
(defun eglot--current-server ()
- "Find the current logical EGLOT server."
+ "Find and cache logical EGLOT server for current buffer."
(or
eglot--cached-current-server
- (let* ((probe (or (project-current)
- `(transient . ,default-directory))))
- (cl-find major-mode (gethash probe eglot--servers-by-project)
- :key #'eglot--major-mode))))
+ (setq eglot--cached-current-server
+ (cl-find major-mode
+ (gethash (or (project-current)
+ `(transient . ,default-directory))
+ eglot--servers-by-project)
+ :key #'eglot--major-mode))))
(defun eglot--current-server-or-lose ()
"Return current logical EGLOT server connection or error."
@@ -1305,12 +1307,10 @@ If it is activated, also signal textDocument/didOpen."
(unless eglot--managed-mode
;; Called when `revert-buffer-in-progress-p' is t but
;; `revert-buffer-preserve-modes' is nil.
- (let ((server (and buffer-file-name (eglot--current-server))))
- (when server
- (setq eglot--unreported-diagnostics `(:just-opened . nil))
- (setq eglot--cached-current-server server)
- (eglot--managed-mode)
- (eglot--signal-textDocument/didOpen)))))
+ (when (and buffer-file-name (eglot--current-server))
+ (setq eglot--unreported-diagnostics `(:just-opened . nil))
+ (eglot--managed-mode)
+ (eglot--signal-textDocument/didOpen))))
(add-hook 'find-file-hook 'eglot--maybe-activate-editing-mode)
(add-hook 'after-change-major-mode-hook 'eglot--maybe-activate-editing-mode)
- [elpa] externals/eglot updated (33a4f86 -> e02479a), João Távora, 2020/04/16
- [elpa] externals/eglot 6dd5de9 05/54: Unbreak imenu, João Távora, 2020/04/16
- [elpa] externals/eglot 243788d 04/54: Force Company to align completion annotations in Eglot sessions, João Távora, 2020/04/16
- [elpa] externals/eglot d5859b5 03/54: Per #319: fix race condition when company-completing quickly, João Távora, 2020/04/16
- [elpa] externals/eglot 576ea2e 02/54: Unbreak M-x vc-revert, which reverts preserving modes, João Távora, 2020/04/16
- [elpa] externals/eglot 32ba9d0 06/54: Expand README.md section on handling quirky servers, João Távora, 2020/04/16
- [elpa] externals/eglot 3d480d1 01/54: Fix #259 (again): fix issue with replace-buffer-contents, João Távora, 2020/04/16
- [elpa] externals/eglot 83b2acb 09/54: Support markdown for textDocument/hover (#329), João Távora, 2020/04/16
- [elpa] externals/eglot de7631d 17/54: Fix #345: set nobreak-char-display to nil in *eglot-help*, João Távora, 2020/04/16
- [elpa] externals/eglot 179a56d 13/54: Only set eglot--cached-current-server by (more aggressive) caching,
João Távora <=
- [elpa] externals/eglot 146108a 15/54: Fix #342: Provide stable eglot-current-server helper, João Távora, 2020/04/16
- [elpa] externals/eglot 8c9078e 19/54: Fix #343: Let other imenu functions work if LSP server's doesn't, João Távora, 2020/04/16
- [elpa] externals/eglot 4bd8773 23/54: Fix #339: fail when eglot-find-* finds no references, João Távora, 2020/04/16
- [elpa] externals/eglot 76d8f49 10/54: Per #50: use completionItem/resolve more abundantly, João Távora, 2020/04/16
- [elpa] externals/eglot a6fa773 25/54: Resolve compilation warnings, João Távora, 2020/04/16
- [elpa] externals/eglot b2e4687 29/54: Close #376: add metals as the language server for Scala, João Távora, 2020/04/16
- [elpa] externals/eglot 097eed5 31/54: Close #382: new eglot-confirm-server-initiated-edits defcustom, João Távora, 2020/04/16
- [elpa] externals/eglot 2ab8b59 08/54: Don't run mode hooks in eglot--format-markup, João Távora, 2020/04/16
- [elpa] externals/eglot 88311a2 12/54: Simplify "maybe"-activation, dump "server" arg, João Távora, 2020/04/16
- [elpa] externals/eglot 7f9784c 11/54: Merge -onoff proxy code into minor mode function, João Távora, 2020/04/16