From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: PL support Date: Sat, 09 May 2020 20:23:12 +0300 Message-ID: <83imh5dnun.fsf@gnu.org> References: <9mmFgzvrBwjt_n_VJyaJdXINraNi5HsGpwq-0MLeKiJA7kG2BQA4uywrzjyz7lpRS0OZDpjEi8lspOKYUA7P_QsODsDew_8nbH960G55fmY=@protonmail.com> <87d07xamrg.fsf@ericabrahamsen.net> <878silajdl.fsf@ericabrahamsen.net> <87tv18pyh4.fsf@russet.org.uk> <83zhaih0oz.fsf@gnu.org> <83pnbegsvm.fsf@gnu.org> <83imh5hby1.fsf@gnu.org> <2e4e8ce9-d857-f3e3-31cf-a40dee67bd25@yandex.ru> <83y2q1dsvh.fsf@gnu.org> <2468efa6-7dbd-8634-44cc-586bb6985f49@yandex.ru> <83pnbddrfd.fsf@gnu.org> <83k11ldpxs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="34353"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, dgutov@yandex.ru To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 19:24:00 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXTCi-0008pr-Jw for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 19:24:00 +0200 Original-Received: from localhost ([::1]:36528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXTCg-0008Ks-L2 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 13:23:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXTC6-0007to-W3 for emacs-devel@gnu.org; Sat, 09 May 2020 13:23:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55936) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXTC6-0002Ha-Ao; Sat, 09 May 2020 13:23:22 -0400 Original-Received: from [176.228.60.248] (port=1085 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXTC5-0001Ni-Fy; Sat, 09 May 2020 13:23:21 -0400 In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Sat, 9 May 2020 18:08:52 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249514 Archived-At: > From: João Távora > Date: Sat, 9 May 2020 18:08:52 +0100 > Cc: Dmitry Gutov , Stefan Monnier , > emacs-devel > > > 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.