[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 32ba9d0 06/54: Expand README.md section on handli
From: |
João Távora |
Subject: |
[elpa] externals/eglot 32ba9d0 06/54: Expand README.md section on handling quirky servers |
Date: |
Thu, 16 Apr 2020 05:31:45 -0400 (EDT) |
branch: externals/eglot
commit 32ba9d09ec40c68b086e6ff0a2d7c3bdd8393df0
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Expand README.md section on handling quirky servers
Also remove explicit cquery support (cquery seems to be dead anyway).
* README.md (Handling quirky servers): New section.
* eglot.el (eglot-initialization-options eglot-cquery): Remove.
---
README.md | 37 +++++++++++++++++++++++++++----------
eglot.el | 13 -------------
2 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md
index 06f8ff1..f0cbc1e 100644
--- a/README.md
+++ b/README.md
@@ -50,17 +50,9 @@ customize `eglot-server-programs`:
(add-to-list 'eglot-server-programs '(foo-mode . ("foo-language-server"
"--args")))
```
-Let me know how well it works and we can add it to the list. If the
-server has some quirk or non-conformity, it's possible to extend Eglot
-to adapt to it. Here's how to get [cquery][cquery] working for
-example:
+Let me know how well it works and we can add it to the list.
-```lisp
-(add-to-list 'eglot-server-programs '((c++ mode c-mode) . (eglot-cquery
"cquery")))
-```
-
-You can also enter a `server:port` pattern to connect to an LSP
-server. To skip the guess and always be prompted use `C-u M-x eglot`.
+To skip the guess and always be prompted use `C-u M-x eglot`.
## Connecting automatically
@@ -102,6 +94,31 @@ it be started as a server. Notice the `:autoport` symbol
in there: it
is replaced dynamically by a local port believed to be vacant, so that
the ensuing TCP connection finds a listening server.
+## Handling quirky servers
+
+Most servers can guess good defaults and will operate nicely
+out-of-the-box, but some need to be configured specially via LSP's
+interfaces. If your server has some quirk or non-conformity, it's
+possible to extend Eglot to adapt to it. Here's an example on how to
+get [cquery][cquery] working:
+
+```lisp
+(add-to-list 'eglot-server-programs '((c++ mode c-mode) . (eglot-cquery
"cquery")))
+
+(defclass eglot-cquery (eglot-lsp-server) ()
+ :documentation "A custom class for cquery's C/C++ langserver.")
+
+(cl-defmethod eglot-initialization-options ((server eglot-cquery))
+ "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)
+ :progressReportFrequencyMs -1)))
+```
+
+See `eglot.el`'s section on Java's JDT server for an even more
+sophisticated example.
+
<a name="reporting bugs"></a>
# Reporting bugs
diff --git a/eglot.el b/eglot.el
index 9a0960d..75ce937 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2512,19 +2512,6 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(setf (eglot--spinner server) (list id title done message)))
-;;; cquery-specific
-;;;
-(defclass eglot-cquery (eglot-lsp-server) ()
- :documentation "Cquery's C/C++ langserver.")
-
-(cl-defmethod eglot-initialization-options ((server eglot-cquery))
- "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)
- :progressReportFrequencyMs -1)))
-
-
;;; eclipse-jdt-specific
;;;
(defclass eglot-eclipse-jdt (eglot-lsp-server) ()
- [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 <=
- [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, 2020/04/16
- [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