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: Dmitry Gutov
Subject: Re: Adding support for xref jumping to headers/interfaces
Date: Mon, 13 Nov 2023 03:02:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 12/11/2023 04:25, João Távora wrote:
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?

What about c++-mode users? Or the devoted sm-c-mode aficionados?

And it would be odd if c++-ts-mode would only function as expected together with Eglot -- at the very least, it will be a challenge to explain this to the users.

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.

We're not just talking about features specific to a language, but features specific to a certain potential future version of a language server, which might or might not be available through a certain LSP client/Xref backend, someday.

Otherwise we could just add those commands now, right?

Aside from the issue of multiple major modes existing for a number of important languages.

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.

And the "...but it works better with it" has often been expressed in terms of minor modes. E.g. SLIME/Sly/CIDER/lots of others.

Etags might be put into that category too (you have to build tags first to use it) -- and all of its language-specific concerns (how to build tags, for example? which flags are preferred) never found its way its major modes.

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.

The Python interpreter always came pre-installed with Python.

Anyway... this was a digression that's probably not important for now. Whether the new advanced commands are defined in Eglot or in major modes, should have no bearing on what we do now, or whether we add a new set of "common" commands to xref.el.



reply via email to

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