emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming eglot -- or at least add an alias?


From: Stephen Leake
Subject: Re: Renaming eglot -- or at least add an alias?
Date: Wed, 12 Oct 2022 23:03:23 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Yuan Fu <casouri@gmail.com> writes:
>
>>> On Oct 11, 2022, at 11:04 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> 
>> IMO in some sense, eglot and major mode sits at the same level, and
>> tree-sitter a level lower. Consider this: take imenu as an example.
>> Major mode sets imenu-create-index-function for imenu to function. A
>> major mode now has two options available, one function uses
>> tree-sitter and one don’t. If the user enables eglot, eglot sets
>> menu-create-index-function to eglot-imenu, overriding major mode’s
>> function. From this perspective, tree-sitter is just a mechanism a
>> major mode could use, not unlike syntax-ppss, while eglot do things
>> its own way, replacing parts of the major mode’s functionality with
>> its own.
>>
>> So it’s not really “two back-ends”, tree-sitter and eglot are
>> different in fundamental ways.
>
> I've just finished changing ada-mode 8.0 to be compatible with eglot (not
> released yet, but soon), and it now very much treats eglot as one of two
> possible backends (with the existing wisi parser and gpr_query the
> other, and tree-sitter being a possible third in the future).
>
> Almost every place where eglot does something by default can be
> disabled, by setting eglot-stay-out-of appropriately.
>
> So major-modes can treat eglot as just an interface to a language
> server.
>
> ada-mode 8.0 provides three variables to control this:
>
> (defcustom ada-face-backend :options '(none eglot wisi)
>
> (defcustom ada-indent-backend :options '(none eglot wisi)
>
> (defcustom ada-xref-backend :options '(gpr_query gnat eglot)
>
> If you have the current ada_language_server installed, but not the Ada
> wisi parser, then ada-face-backend defaults to none, since that server
> doesn't support it. Similarly for the other backends.
>
> I should have initial feedback from beta testers in a month or so.

Thinking about this some more, I realized there are other features that
the user might want to control:

signature help - show the function signature when point is in a function
name. ada-mode does not currently do this, and users might want to turn
it off.

completion - gpr_query does this for ada-mode, but eglot is always
better, so it is used if available. 

diagnostics - error messages from the parser for syntax errors in the
file; eglot displays them via flymake. ada-mode also does this (not
using flymake) - I have not considered how to handle them fighting each
other, but I will probably have to disable one or the other.

-- 
-- Stephe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]