From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Thu, 10 Jun 2021 08:59:52 -0700 Message-ID: <1e35f101-ceba-9797-cd4f-070dc32071cc@gmail.com> References: <83o8cge4lg.fsf@gnu.org> <62e438b5-d27f-1d3c-69c6-11fe29a76d74@dancol.org> <83fsxsdxhu.fsf@gnu.org> <83pmwudgw3.fsf@gnu.org> <20210610151647.qtt7pqbjhdtp6coe@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40562"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, emacs-devel@gnu.org, rudalics@gmx.at, monnier@iro.umontreal.ca, Eli Zaretskii , dancol@dancol.org To: Ergus , Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 10 18:03:48 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 1lrN9o-000AR4-Bc for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Jun 2021 18:03:48 +0200 Original-Received: from localhost ([::1]:40498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrN9n-0000Df-8r for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Jun 2021 12:03:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrN64-00019P-Rf for emacs-devel@gnu.org; Thu, 10 Jun 2021 11:59:56 -0400 Original-Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:45745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrN63-0004dM-3R; Thu, 10 Jun 2021 11:59:56 -0400 Original-Received: by mail-pj1-x102a.google.com with SMTP id z3-20020a17090a3983b029016bc232e40bso4115976pjb.4; Thu, 10 Jun 2021 08:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=xkPGUOVOigkjjUFclDgrHzHtVCGnI5sbSDNRZAG3bIo=; b=tWdp2GO6H3UnpBW9Bn/mQ9eO4NwvUhfZ30WP01N7PLcXtFj9ycxBEEV8QVCX753I13 aCl7R08J02Jvhva0yRbUsu8iWA0+zz/FpYDeMETSl9r7k3lj3nr1ZBgOETQ3BwE0qvRW dkhPYrR32Is7V5KGwg7rk5Fg/1JmsepgffeWfHU/eexozSona5Ooicn/SvjY9JCrI3Iq XuOeuCfxRvuyVUO/elqEst5fvrUTf2tYY+WgrytU/GTI4Iu6ejnl/m9tO7U1L2H3e/Am owEDtGltcz7KWuiH2xRmcBIymZqkDluYrhScgg3VkHiMZm9N3EzhZwcMb00hNYRAKejo tCwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xkPGUOVOigkjjUFclDgrHzHtVCGnI5sbSDNRZAG3bIo=; b=NcUcp1ygqHl2byQTXmOy9XwP6HIsB4Vo5pP5o2CNHMnLlL1ndvaiy0HsirQCZmcRUX y4H1ndkVFGGZA0yNwmrmY32SVY7pVij5xATWIywrj8G/gXJbCNfVzxHGbv2EpispKWe1 H62DJlEFjVT7agcD36TMEOe6vB8V7xpgT/ZgUagOJUu/o1fAahSskain0vAMWsur8St2 XGaYcdGRpu9mknBP8aAqRajtKAOBooQtKWzJ/CfpJZrBaQJcerih+cF8LccuTqmjbeY7 U6WNu5xMNEHFhKcGSOMeVitjs/ZBI2uTBglr4FnkhVNrx9uhom26LJqczeXeNOmKa5WZ Qkbg== X-Gm-Message-State: AOAM5324kFqXhgxGEiikha850WA6DY+KuIrqMEehFZr0Fi6Ef8Srxz3d 7514warD88K7WU/nqJGrSAHC4K/4+Ag= X-Google-Smtp-Source: ABdhPJxTtUTjRM5h2B5fD/Xdkx1DbEndQF4mUhEeqsvMUQxfeccUdCkMfRtAzduFckJF4G+ELwzQ1w== X-Received: by 2002:a17:90a:590d:: with SMTP id k13mr4221944pji.68.1623340792162; Thu, 10 Jun 2021 08:59:52 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id 1sm8495403pjm.8.2021.06.10.08.59.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 08:59:51 -0700 (PDT) In-Reply-To: <20210610151647.qtt7pqbjhdtp6coe@Ergus> Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:270651 Archived-At: On 6/10/2021 8:16 AM, Ergus wrote: > 1) What is finally the most desirable/long path/future feature? I mean,, > finally what is preferred by the developers to support in the future? > > lsp or tree-sitter? Elsewhere in the thread, I and a few others discussed this briefly. The solution other editors use (and which I think is ideal) is to start with a base that does its best purely by looking at the syntax of the file, and then augment that with LSP. For Emacs and CC-mode, this could mean continuing to use the current implementation, or switching to something built on tree-sitter. Then on top of that, Emacs can consult LSP for more-accurate information. I'm not sure whether this means LSP would take over entirely or if it would merely augment the base-level syntactic highlighting. Figuring that out would probably require doing some experiments to see what the best solution for Emacs would look like. One of the main benefits of continuing to have some form of (non-LSP) syntactic highlighting is that it works for everyone. Even if you don't have an LSP server installed, you may want to edit a source file in a particular language. Your LSP server of choice may also lack full semantic highlighting support (it's a pretty new feature, as I understand it). Having a reasonably-correct baseline that works everywhere is nice, and hopefully there are no plans to get rid of that. LSP *may* also be too slow in some situations (though this is just a guess). For example, when editing a file over TRAMP, the LSP server runs on the remote side; if the network is slow, this could result in delayed fontification while editing, which reduces the usefulness of fontification. In addition, a new checkout of a large project won't have any cached LSP information, so analyzing the code enough to generate semantic highlighting may take some time. These might not actually be problems, but they do make me a bit skeptical about the performance of a purely LSP-based fontification system. - Jim