From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sebastian Poeplau Newsgroups: gmane.emacs.devel Subject: Re: eglot's interface for major modes Date: Thu, 13 Apr 2023 21:36:12 +0200 Message-ID: <87wn2fva1t.fsf@mailbox.org> References: <874jpr35eh.fsf@mailbox.org> <86v8i7tmda.fsf@stephe-leake.org> <87jzymzqh2.fsf@betli.tmit.bme.hu> <87ttxjhe42.fsf@betli.tmit.bme.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18061"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Stephen Leake , emacs-devel@gnu.org To: Felician Nemeth Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 14 07:41:38 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pnCBm-0004UB-At for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Apr 2023 07:41:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnCAf-0000eX-2M; Fri, 14 Apr 2023 01:40:29 -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 1pn2v9-0005pP-QU for emacs-devel@gnu.org; Thu, 13 Apr 2023 15:47:51 -0400 Original-Received: from mout-p-202.mailbox.org ([80.241.56.172]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pn2v5-0002ds-GH for emacs-devel@gnu.org; Thu, 13 Apr 2023 15:47:51 -0400 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Py98v1YQVz9sXg; Thu, 13 Apr 2023 21:47:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1681415263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kvu4X99bKQg73S7gmi3gZNLWFo5zdBX+tHXMKG7UMKQ=; b=DdxRNUzYJgzXdfMEzngii5uJB1oA8mebfZ7HFFTp8us5IyaLGqeLgUTzAnmQz968Efve3W BWKMX5sqOW6WJNx4AKn53DAVwnzKxZPNbS8tMZjoffyGGHOR3WviCbY7mfYgLQp5/Kz2Gr Pw18ykXt6Tr5Dw/BcVyWRpskvpOoDBWmEoXF5Upxb5z6mxfzRQEW88lr9UZ6dVTV78Wr9R SifVYirQf6r0cowlJqdx692YWITQZskNp6S64wdfUOHz7X+0Cu9vnrcCqTtO3rXGZnqL45 ZP4TATL2SSC4DhDYxd35L3dgLq6w9O8g4VvnMBZ9pxFHhJr5Go/q7Froa3YVWQ== In-reply-to: <87ttxjhe42.fsf@betli.tmit.bme.hu> X-MBO-RS-META: uws3uctyzjnfgn5d4xoqxn8tyr4s8iqt X-MBO-RS-ID: cea8760220fcc08710e Received-SPF: pass client-ip=80.241.56.172; envelope-from=sebastian.poeplau@mailbox.org; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 14 Apr 2023 01:40:26 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305306 Archived-At: > Sebastian's version does not fully implement the protocol, but the Ada > Langauge Server might be a good choice to test the implementation > against. In his example, the server sends the window/showDocument > request in reaction to an eglot-execute-command client-request. I don't > know if that complicates a potential testing process. Probably not. If you'd like to experiment with the Ada Language Server, here's how to set up a minimal project: minimal_project/ =E2=94=9C=E2=94=80=E2=94=80 main.adb =E2=94=9C=E2=94=80=E2=94=80 main.ads =E2=94=94=E2=94=80=E2=94=80 project.gpr The project definition in project.gpr is this: Project P is for Main use ("main.adb"); end P; The specification of the main unit (main.ads): procedure Main; And the equally useful body (main.adb): procedure Main is null; It's not a very useful project, but it's enough to make the server respond to "als-other-file" in main.ad[bs]. You can download a prebuilt binary of the language server [1] or use the Alire package manager to build your own [2]. Then you can use the custom major mode from my initial message [3] and run the `ada-light-other-file' command; the mode already monkey-patches eglot with my (admittedly incomplete) handler for "window/showDocument". If you want to silence the language server's warning about the lack of an explicitly specified project file, set `eglot-workspace-configuration' to (:ada (:projectFile "project.gpr")). [1] https://github.com/AdaCore/ada_language_server/releases/tag/23.0.16 [2] https://alire.ada.dev/crates/ada_language_server.html [3] https://github.com/sebastianpoeplau/ada-light-mode