emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding support for xref jumping to headers/interfaces


From: João Távora
Subject: Re: Adding support for xref jumping to headers/interfaces
Date: Sun, 12 Nov 2023 02:25:12 +0000

On Sun, Nov 12, 2023 at 2:10 AM Dmitry Gutov <dmitry@gutov.dev> wrote:
>
> On 12/11/2023 04:08, João Távora wrote:
> > Noooo.  Eglot only does LSP things!
>
> Server-specific extensions are LSP things, in my book. Okay, it might
> not be in eglot.el itself, but then someone will create
> eglot-superduperclang.el to support those extensions.

Could be, but why can't this code live in c++-ts-mode?

> > The major mode may do that if
> > it has another alternative backend, or if it knows it is using LSP
> > with a specific language server, like 'superduperclangdfork'.
>
> I'm pretty sure major modes that are specific to the language server in
> use are a bad idea.

You may have misunderstood my suggestion.

I'm saying code specific to certain languages, LSP-based on not,
should always live in major mode files and have major-mode prefixes.
It's always been like this.  The LSP server program doesn't have
to be available for themajor mode to work, but it works better
with it.

Major modes already do this.  For example, you don't _have_ to
have a Python interpreter program to use python-mode.el to edit
Python code,  but having one enables M-x run-python of course.
And run-python uses comint.el which is a library that python.el
relies on.

Just like it could and should rely on eglot.el if it wants to
offer M-x python-find-super-special-annotation with the
'superduperpyright' LSP server program.

I'm fairly sure other major modes do this.  octave-mode
comes to mind, and probably others.

João



reply via email to

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