From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Sat, 05 Jun 2021 20:32:37 +0300 Message-ID: <83zgw4i5e2.fsf@gnu.org> References: <831r9iw473.fsf@gnu.org> <87h7ieyma7.fsf@gmail.com> <15be7dd8-e901-e317-5111-e1a34f6f0416@gmail.com> <83k0n9l9pv.fsf@gnu.org> <83eedhl83r.fsf@gnu.org> <8735txfkk7.fsf@fastmail.fm> <837dj8ls7d.fsf@gnu.org> <87y2bo9r42.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?=D3scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 05 19:33:54 2021 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 1lpaBF-0003xJ-Rt for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Jun 2021 19:33:53 +0200 Original-Received: from localhost ([::1]:53734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpaBE-0003hj-Sd for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Jun 2021 13:33:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpaA7-0002O4-Lt for emacs-devel@gnu.org; Sat, 05 Jun 2021 13:32:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53458) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpaA6-0006ov-TB; Sat, 05 Jun 2021 13:32:42 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1879 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpaA6-0006Pw-EY; Sat, 05 Jun 2021 13:32:42 -0400 In-Reply-To: <87y2bo9r42.fsf@telefonica.net> (message from =?iso-8859-1?Q?=D3scar?= Fuentes on Sat, 05 Jun 2021 19:08:13 +0200) 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:270443 Archived-At: > From: Óscar Fuentes > Date: Sat, 05 Jun 2021 19:08:13 +0200 > > If we are going to really modernize Emacs' programming language support > we need to provide more than parser-based syntax highlighting and > indentation. We need smart code completion, code hints, transformations, > etc. Yes, we need that, and much more. But if we reject partial solutions because they aren't 110% perfect with every PL out there, we get to stay with what we have now, which is much worse. So in my book incremental improvements using contemporary technology are a win, even if they don't get us all the way to the ultimate goal. Let's not discourage potential volunteers from taking up the job of bringing stuff like tree-sitter to Emacs because it may not be perfect for some demanding languages. > That means we need something like LSP. We need to try both these technologies, before we make the decision. Each one of them has upsides and downsides, and it is therefore unwise, IMO, to put all the eggs into a single basket. Chances are we will want to keep both solutions handy, because they can be complementary. > Tree-sitter migth be useful for the languages not yet supported by > LSP, though (but, if I got it right, tree-sitter is implemented on > Javascript, so it requires a JS engine to work, maybe too much of a > dependency for something that doesn't add that much over what we > have now.) That's secondary, IMO. If the main issues are solved satisfactorily, I don't expect too much time to pass before someone comes up with a way of producing the tree-sitter grammars in Emacs Lisp. > > I think you'd expect a good LSP server to "degrade gracefully" and still > > provide good info for indentation and syntax highlighting even if you > > only have the one file and all the other files in the project > > are missing. > > As already mentioned elsewhere on this thread, an LSP server with access > to just the current file is severely handicapped. One thing is to miss > the information about some functions yet-to-be-written and another thing > entirely is to ignore everything not defined on the current file. Once again, my suggestion is not to require perfect solutions, especially since what we have now is nowhere near perfection.