all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#65359: [PATCH] eglot: add "lexical" LSP server
@ 2023-08-18  1:38 Mou Tong
  2023-08-18  6:00 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Mou Tong @ 2023-08-18  1:38 UTC (permalink / raw)
  To: 65359


[-- Attachment #1.1: Type: text/plain, Size: 948 bytes --]

There is a new LSP server for elixir: [lexical].

Although it said there had problems to use it with eglot, but I didn't
meet the [problem] it said in the instruction.

And I had used it for serveral projects and it worked fine, I put this
in my config and I don't know if there is a better way:

```emacs-lisp
(with-eval-after-load 'eglot
  (setf (alist-get '(elixir-mode elixir-ts-mode heex-ts-mode)
                   eglot-server-programs
                   nil nil #'equal)
        (eglot-alternatives
         `(("start_lexical.sh")
           ,(if (and (fboundp 'w32-shell-dos-semantics)
                     (w32-shell-dos-semantics))
                '("language_server.bat")
              '("language_server.sh"))))))
```

So I send a patch like this.

[lexical]: https://github.com/lexical-lsp/lexical

[problem]: https://github.com/lexical-lsp/lexical/blob/main/pages/installation.md#vanilla-emacs-with-eglot


[-- Attachment #1.2: Type: text/html, Size: 2829 bytes --]

[-- Attachment #2: 0001-Add-lexical-LSP-server-to-Eglot.patch --]
[-- Type: application/octet-stream, Size: 1639 bytes --]

From f4789e6215291ca2be95f443e0d2a1b122a44b0d Mon Sep 17 00:00:00 2001
From: dalu <mou.tong@outlook.com>
Date: Thu, 17 Aug 2023 18:34:42 +0800
Subject: [PATCH] Add "lexical" LSP server to Eglot

---
 lisp/progmodes/eglot.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 113ff08e94e..be7ed54c71d 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -219,10 +219,12 @@ eglot-server-programs
                                  . ("dart" "language-server"
                                     "--client-id" "emacs.eglot-dart"))
                                 ((elixir-mode elixir-ts-mode heex-ts-mode)
-                                 . ,(if (and (fboundp 'w32-shell-dos-semantics)
-                                             (w32-shell-dos-semantics))
-                                        '("language_server.bat")
-                                      '("language_server.sh")))
+                                 . ,(eglot-alternatives
+                                     `(("start_lexical.sh")
+                                       ,(if (and (fboundp 'w32-shell-dos-semantics)
+                                                 (w32-shell-dos-semantics))
+                                            '("language_server.bat")
+                                          '("language_server.sh")))))
                                 (ada-mode . ("ada_language_server"))
                                 (scala-mode . ,(eglot-alternatives
                                                 '("metals" "metals-emacs")))
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-19 14:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18  1:38 bug#65359: [PATCH] eglot: add "lexical" LSP server Mou Tong
2023-08-18  6:00 ` Eli Zaretskii
2023-08-18  6:19   ` Mou Tong
2023-08-18  6:39     ` Eli Zaretskii
2023-08-18  7:08       ` Mou Tong
2023-08-19  8:38         ` Eli Zaretskii
2023-08-19 10:51           ` João Távora
2023-08-19 14:11             ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.