From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65359: [PATCH] eglot: add "lexical" LSP server Date: Fri, 18 Aug 2023 09:00:02 +0300 Message-ID: <83pm3k51r1.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40213"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65359@debbugs.gnu.org To: Mou Tong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 18 08:01:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qWsXy-000AII-Mc for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Aug 2023 08:01:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWsXs-0002o7-GT; Fri, 18 Aug 2023 02:01:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWsXd-0002nj-NU for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 02:01:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWsXd-0001kp-EZ for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 02:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWsXd-00086x-Jm for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 02:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Aug 2023 06:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65359 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65359-submit@debbugs.gnu.org id=B65359.169233841631108 (code B ref 65359); Fri, 18 Aug 2023 06:01:01 +0000 Original-Received: (at 65359) by debbugs.gnu.org; 18 Aug 2023 06:00:16 +0000 Original-Received: from localhost ([127.0.0.1]:45930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWsWu-00085g-03 for submit@debbugs.gnu.org; Fri, 18 Aug 2023 02:00:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWsWr-00084H-HE for 65359@debbugs.gnu.org; Fri, 18 Aug 2023 02:00:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWsWl-0001QJ-Qy; Fri, 18 Aug 2023 02:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/BAw138D06dwwyCAx3bhkzA9RLMN8VNEv2YenShArA8=; b=d2JKYkjPh9CN aQQxWwMn5pQmCiq4+Rpx+EMnhJTvrRp3UoidI3MQiaByu6G5uDqbYEErfXmUuXD5zgv55jkK8dQhY SUniGZpb/u7lfvOob1z62hZ6crizss4QsgzCyl+xb2Ou4FpWOLOwRyKlYWe+V+REUpX7JQW2nE0pK OICji0u6+nY9XrbyrDoM8X3XRT4sXgmCidO4YgBc3Sd7v1jB29EExDeY5b2yk4PwYe9nqrvK2TDiR nSoZRCvqkk3jxvNaoyJpmdfFXhk2zfE0P+dzX0CVKQbVawwxUwQoWzq+haxpclsuPJIAmtz5/fDOu qMQBpx3uwps6XBkV/SfuOg==; In-Reply-To: (message from Mou Tong on Fri, 18 Aug 2023 01:38:39 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267720 Archived-At: > From: Mou Tong > Date: Fri, 18 Aug 2023 01:38:39 +0000 > > 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 > > > From f4789e6215291ca2be95f443e0d2a1b122a44b0d Mon Sep 17 00:00:00 2001 > From: dalu > 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"))) Thanks, but the fact the command is a shell script again needs the w32-shell-dos-semantics dance, like language_server.sh did.