[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 2355e17 23/62: Per #63: Accept functions as entri
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot 2355e17 23/62: Per #63: Accept functions as entries in eglot-server-programs |
Date: |
Sat, 29 Sep 2018 17:13:31 -0400 (EDT) |
branch: externals/eglot
commit 2355e171328d09628629cc990894efa014019874
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
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] externals/eglot dfaa389 12/62: * README.md (Installation and usage): Add haskell-ide-engine, (continued)
- [elpa] externals/eglot dfaa389 12/62: * README.md (Installation and usage): Add haskell-ide-engine, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot a6cad6b 15/62: Fix typo in willSaveWaitUntil RPC request (#51), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 2728e12 22/62: Per #59: eglot-workspace-configuration's keys needn't be keywords, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot fd7e587 27/62: Require jsonrpc.el 1.0.2 (GNU ELPA didn't build 1.0.1), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 99fd6a4 30/62: * eglot.el (eglot-cquery): Capitalize docstring., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot fdd021c 26/62: Close #61: Snappier completions that don't hinder typing, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 22b0c89 41/62: Add kotlin-language-server (#70), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 3ffea45 44/62: Close #50: Support snippet completions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e711bdb 47/62: Add go-langserver (#74), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 83d7025 36/62: Close #68: Implement asynchronous server connection, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 2355e17 23/62: Per #63: Accept functions as entries in eglot-server-programs,
Stefan Monnier <=
- [elpa] externals/eglot c0f9db7 46/62: Per #74: Don't error if server replies with empty hover message, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot be15bb1 43/62: Per #74: Fix eglot-capabilities when querying for multiple features, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 15040a6 48/62: Improve snippet support, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot d88f6aa 54/62: Close #86: Handle case when :textDocumentSync isn't a number, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 42fffa5 16/62: Close #54: Correctly make LSP positions in narrowed buffers, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e935718 20/62: Fix placement of diagnostics with same start and end positions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 88ebed6 17/62: Implement TextDocument/rangeFormatting, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 792dc6b 28/62: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 21886be 08/62: Close #44: Robustify in the face of manual mode changes, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6b14711 18/62: * eglot.el (eglot-client-capabilities): Fix a typo., Stefan Monnier, 2018/09/29