[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 1.2 d48e737 017/101: Per #63: Accept functions as entries in eglo
From: |
Christian Johansson |
Subject: |
[elpa] 1.2 d48e737 017/101: Per #63: Accept functions as entries in eglot-server-programs |
Date: |
Thu, 29 Apr 2021 15:08:52 -0400 (EDT) |
tag: 1.2
commit d48e737ccdb665fe362c8a2e255429afdf44bcf4
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Per #63: Accept functions as entries in eglot-server-programs
CONTACT in the (MAJOR-MODE . CONTACT) association in
eglot-server-programs can now be a function of no arguments producing
any value previously valid for contact. The function is called at
time of `M-x eglot` or `eglot-ensure`. This is useful for servers
requiring command-line invocations that depend on the specific
momentary environment.
* eglot.el (eglot-server-programs): CONTACT can be a fucntion of no
arguments.
(eglot--guess-contact, eglot--connect): Accept function
CONTACTs.
---
eglot.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/eglot.el b/eglot.el
index c3a0d51..33b478f 100644
--- a/eglot.el
+++ b/eglot.el
@@ -121,7 +121,10 @@ of those modes. CONTACT can be:
converted to produce a plist with a suitable :PROCESS initarg
to CLASS-NAME. The class `eglot-lsp-server' descends
`jsonrpc-process-connection', which you should see for the
- semantics of the mandatory :PROCESS argument.")
+ semantics of the mandatory :PROCESS argument.
+
+* A function of no arguments producing any of the above values
+ for CONTACT.")
(defface eglot-mode-line
'((t (:inherit font-lock-constant-face :weight bold)))
@@ -310,6 +313,7 @@ be guessed."
(lambda (m1 m2)
(or (eq m1 m2)
(and (listp m1) (memq m2 m1)))))))
+ (guess (if (functionp guess) (funcall guess) guess))
(class (or (and (consp guess) (symbolp (car guess))
(prog1 (car guess) (setq guess (cdr guess))))
'eglot-lsp-server))
@@ -457,6 +461,7 @@ This docstring appeases checkdoc, that's all."
(nickname (file-name-base (directory-file-name default-directory)))
(readable-name (format "EGLOT (%s/%s)" nickname managed-major-mode))
autostart-inferior-process
+ (contact (if (functionp contact) (funcall contact) contact))
(initargs
(cond ((keywordp (car contact)) contact)
((integerp (cadr contact))
@@ -1658,7 +1663,7 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
"Passes through required cquery initialization options"
(let* ((root (car (project-roots (eglot--project server))))
(cache (expand-file-name ".cquery_cached_index/" root)))
- (list :cacheDirectory (file-name-as-directory cache)
+ (list :cacheDirectory (file-name-as-directory cache)Ini
:progressReportFrequencyMs -1)))
- [elpa] 1.2 updated (f291816 -> e70be91), Christian Johansson, 2021/04/29
- [elpa] 1.2 1015f83 004/101: Per #48: Fix messages of eglot-ensure, Christian Johansson, 2021/04/29
- [elpa] 1.2 4a7086e 016/101: Per #59: eglot-workspace-configuration's keys needn't be keywords, Christian Johansson, 2021/04/29
- [elpa] 1.2 310e527 006/101: * README.md (Installation and usage): Add haskell-ide-engine, Christian Johansson, 2021/04/29
- [elpa] 1.2 f2a6aa3 010/101: Close #54: Correctly make LSP positions in narrowed buffers, Christian Johansson, 2021/04/29
- [elpa] 1.2 d845453 019/101: Close #60: Notify server of recent changes before save notification, Christian Johansson, 2021/04/29
- [elpa] 1.2 d8c1f5d 026/101: Improve eglot-execute-command API to ease overriding by servers, Christian Johansson, 2021/04/29
- [elpa] 1.2 d48e737 017/101: Per #63: Accept functions as entries in eglot-server-programs,
Christian Johansson <=
- [elpa] 1.2 b0c6e17 035/101: Add kotlin-language-server (#70), Christian Johansson, 2021/04/29
- [elpa] 1.2 38a27be 029/101: Add a test for eglot-ensure. Make, Christian Johansson, 2021/04/29
- [elpa] 1.2 05e5a9f 063/101: Per #63: Allow function contacts to be interactive, Christian Johansson, 2021/04/29
- [elpa] 1.2 922f4e5 060/101: Merge pull request #104 from mkcms/fix-diagnostics-wrong-type-argument, Christian Johansson, 2021/04/29
- [elpa] 1.2 7b78b15 055/101: Autoload eglot-ensure (#120), Christian Johansson, 2021/04/29
- [elpa] 1.2 bfadd9a 053/101: Close #100: Don't send other notifications before initialized, Christian Johansson, 2021/04/29
- [elpa] 1.2 737f08d 056/101: Correctly map DocumentSymbol's :kind to its name (#121), Christian Johansson, 2021/04/29
- [elpa] 1.2 3c9e00e 068/101: * .travis.yml (install): Download eclipse.jdt.ls server., Christian Johansson, 2021/04/29
- [elpa] 1.2 be464f2 005/101: Add entry for haskell-ide-engine in eglot-server-programs (#49), Christian Johansson, 2021/04/29
- [elpa] 1.2 0694579 009/101: Fix typo in willSaveWaitUntil RPC request (#51), Christian Johansson, 2021/04/29