[Top][All Lists]

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

Re: PL support

From: João Távora
Subject: Re: PL support
Date: Sat, 9 May 2020 18:08:52 +0100

On Sat, May 9, 2020 at 5:38 PM Eli Zaretskii <address@hidden> wrote:
> > You said you'd like to see "more of Eglot's LSP support" in the core, two
> > years ago:
> >
> >    https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00419.html
> I very much doubt Dmitry was replying to that 2-year old message.  He
> was replying to what I said today.

I didn't say he was. I just pasted the message to give you context
about what my perception of the plan was.

> > set of Elisp macros that allow for compile-time and run-time checking
> > of LSP messages, among other LSP-specific but interface-agnostic
> > details.
> >
> > Shall I start working on that?
> What I'd like to see is a way to switch language-specific features in
> CC Mode to LSP or some other similar facility.

I was only speaking of the LSP facility.  If you have reasons to think
that tree-sitter completely obviates the need for LSP in Emacs (I don't),
then you should let me know to prevent me from doing unnecessary work.

> Assuming that doing so
> will make CC Mode faster and more accurate, that is.

Be aware that that depends on an external server program, and I we
don't control that now and likely for some time. Also be aware
syntax-highlighting support is still being finished in the protocol (but so
close to it that  LSP's maintainer said days ago they are "in endgame").

Now, I have to address what I believe is a misperception of how LSP
can work in Emacs.  eglot.el delivers a minor mode that works
independently of the major mode.  In contrast to lsp-mode.el, there
is no language-specific code in eglot.el (apart from 2 minor exceptions
which we'll soon dispose of). Anyway the only thing that eglot/LSP
can do for cc-mode.el specifically is ask it to define the file-name of a
preferred language server program and enable eglot-managed-mode
by default.  Nothing more. Then we have to work on eglot.el (or
wherever the choice befalls) to start supporting the syntax
highlighting features whereby font-locking information are
gathered from the server.   Since exchanging information about
source-file changes is largely a solved problem, as soon as servers
start declaring support the new syntax highlighting extensions, it's
is a question of applying the text properties in an efficient manner.

Anyway, it is is because of this loose coupling that Dmitry says
that Eglot could live "forever" outside of the core.  And it's mostly
true.  But I do believe that if it were in the core (like if company.el
or an equivalent library was in the core) that would help even
more CC Mode users (or Foo Mode users) discover LSP's advantages,
especially if Emacs also started distributing an LSP server program
for C or FOO.


reply via email to

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