[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 4501831 02/11: Close #12: support purposedly igno
From: |
João Távora |
Subject: |
[elpa] externals/eglot 4501831 02/11: Close #12: support purposedly ignoring a server capability |
Date: |
Sun, 10 Jun 2018 09:57:28 -0400 (EDT) |
branch: externals/eglot
commit 45018319e8ede9734929baf2f45bffcea80b0e48
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Close #12: support purposedly ignoring a server capability
* eglot.el (eglot-ignored-server-capabilites): New defcustom.
(eglot--server-capable): Use it.
---
eglot.el | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/eglot.el b/eglot.el
index de8d990..0869bd5 100644
--- a/eglot.el
+++ b/eglot.el
@@ -816,16 +816,26 @@ If optional MARKER, return a marker instead"
(ignore-errors (funcall mode))
(insert string) (font-lock-ensure) (buffer-string))))
+(defcustom eglot-ignored-server-capabilites (list)
+ "LSP server capabilities that Eglot could use, but won't.
+You could add, for instance, the symbol
+`:documentHighlightProvider' to prevent automatic highlighting
+under cursor."
+ :type '(repeat symbol))
+
(defun eglot--server-capable (&rest feats)
"Determine if current server is capable of FEATS."
- (cl-loop for caps = (eglot--capabilities (eglot--current-server-or-lose))
- then (cadr probe)
- for feat in feats
- for probe = (plist-member caps feat)
- if (not probe) do (cl-return nil)
- if (eq (cadr probe) t) do (cl-return t)
- if (eq (cadr probe) :json-false) do (cl-return nil)
- finally (cl-return (or probe t))))
+ (unless (cl-some (lambda (feat)
+ (memq feat eglot-ignored-server-capabilites))
+ feats)
+ (cl-loop for caps = (eglot--capabilities (eglot--current-server-or-lose))
+ then (cadr probe)
+ for feat in feats
+ for probe = (plist-member caps feat)
+ if (not probe) do (cl-return nil)
+ if (eq (cadr probe) t) do (cl-return t)
+ if (eq (cadr probe) :json-false) do (cl-return nil)
+ finally (cl-return (or probe t)))))
(defun eglot--range-region (range &optional markers)
"Return region (BEG . END) that represents LSP RANGE.
- [elpa] externals/eglot updated (e103d5f -> e460e50), João Távora, 2018/06/10
- [elpa] externals/eglot 1f7bcb1 06/11: Slightly polish the Flymake integration, João Távora, 2018/06/10
- [elpa] externals/eglot 327119e 04/11: Shoosh compiler, João Távora, 2018/06/10
- [elpa] externals/eglot 7bd271f 05/11: * eglot.el (eglot--make-process): Use 'utf-8-emacs-unix, João Távora, 2018/06/10
- [elpa] externals/eglot 4501831 02/11: Close #12: support purposedly ignoring a server capability,
João Távora <=
- [elpa] externals/eglot 5e63dcb 03/11: Cleanup the Flymake 26.1 hack slightly, João Távora, 2018/06/10
- [elpa] externals/eglot 133bee1 01/11: Fix typos, João Távora, 2018/06/10
- [elpa] externals/eglot 94fa254 07/11: Close #16: check flymake-mode before calling report-fn, João Távora, 2018/06/10
- [elpa] externals/eglot 1506172 10/11: Close #17: New eglot-ensure to put in a major-mode's hook, João Távora, 2018/06/10
- [elpa] externals/eglot f6bb0a7 08/11: Attempt to handle RLS sophisticated globs for didChangeWWatchedFiles, João Távora, 2018/06/10
- [elpa] externals/eglot e460e50 11/11: * eglot.el (Version): Bump to 0.9, João Távora, 2018/06/10
- [elpa] externals/eglot 935edcc 09/11: Fix indentation address@hidden by previous commit, João Távora, 2018/06/10