unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sebastian Poeplau <sebastian.poeplau@mailbox.org>
To: Felician Nemeth <felician.nemeth@gmail.com>
Cc: "João Távora" <joaotavora@gmail.com>,
	"Stephen Leake" <stephen_leake@stephe-leake.org>,
	emacs-devel@gnu.org
Subject: Re: eglot's interface for major modes
Date: Thu, 13 Apr 2023 21:36:12 +0200	[thread overview]
Message-ID: <87wn2fva1t.fsf@mailbox.org> (raw)
In-Reply-To: <87ttxjhe42.fsf@betli.tmit.bme.hu>

> 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/
  ├── main.adb
  ├── main.ads
  └── 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



  reply	other threads:[~2023-04-13 19:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 18:20 eglot's interface for major modes Sebastian Poeplau
2023-04-07 21:26 ` Stephen Leake
2023-04-08  9:13   ` Felician Nemeth
2023-04-08  9:37     ` Sebastian Poeplau
2023-04-11 14:05       ` Felician Nemeth
2023-04-13 19:24         ` Sebastian Poeplau
2023-04-13 16:22     ` João Távora
2023-04-13 17:43       ` Felician Nemeth
2023-04-13 19:36         ` Sebastian Poeplau [this message]
2023-04-08  9:26   ` Sebastian Poeplau
2023-04-08 10:30     ` Stephen Leake
2023-04-08 10:53       ` Sebastian Poeplau
2023-04-12 23:06         ` Stephen Leake
2023-04-13 19:23           ` Sebastian Poeplau
2023-04-15 16:38             ` Stephen Leake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn2fva1t.fsf@mailbox.org \
    --to=sebastian.poeplau@mailbox.org \
    --cc=emacs-devel@gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=joaotavora@gmail.com \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).