emacs-devel
[Top][All Lists]
Advanced

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

Re: PL support


From: Eli Zaretskii
Subject: Re: PL support
Date: Sat, 09 May 2020 20:23:12 +0300

> From: João Távora <address@hidden>
> Date: Sat, 9 May 2020 18:08:52 +0100
> Cc: Dmitry Gutov <address@hidden>, Stefan Monnier <address@hidden>, 
>       emacs-devel <address@hidden>
> 
> > 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.

I didn't mention tree-sitter in my message.  So why are you talking
about it?

> > 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.

I understand all this, albeit not on the same level of detail as you
do.  What I'm saying is that from my POV our goal is to go all the way
towards bringing this technology to major modes.  The instructions to
turn on this support should include everything that's needed:
installing packages, running the LSP server, customizing the major
mode, etc. etc. -- everything that's needed to have the mode run with
LSP as its backend for these language-dependent features.

IOW, just having a mode that can talk to the LSP server is good
progress, but it stops short of the goal I think we should target.

> 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.

I'm aware of the controversy regarding what should be in core and what
should be left on ELPA.  Heck, I'm part of that controversy.  But I
don't think we will ever be able to come close to resolving it
regarding Eglot unless we have support for it in major modes ready to
be turned on.  Only then will people be able to try it, see if they
like it, and then have some real basis for opining whether it should
or shouldn't be in core.  IOW, the level of success in having the
related features beefed up using Eglot is IMO a very significant
factor in forming people's opinions about making it part of core.



reply via email to

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