A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00965.html below:

Re: Tree sitter support for C-like languages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Eli Zaretskii Subject: Re: Tree sitter support for C-like languages Date: Tue, 15 Nov 2022 20:38:57 +0200
> From: Yuan Fu <casouri@gmail.com>
> Date: Tue, 15 Nov 2022 10:18:21 -0800
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
>  theo@thornhill.no,
>  emacs-devel@gnu.org
> 
> > Maybe we should grow some augmentations for tree-sitter, at least
> > given enough time.  Or maybe it's possible to identify the parts where
> > this happens by some tree-sitter indications, and tweak the faces in
> > those regions in some way.
> 
> I don’t know how could you improve this in tree-sitter since macros are 
> literally “define you own syntax”. We can reasonably fix the highlighting for 
> some of our macros like DEFUN. As a demonstration I added some 
> emacs-devel-specific rules (that are disabled by default). Run this:
> 
> (add-hook 'c-ts-mode-hook
>           (lambda ()
>             (treesit-font-lock-recompute-features '(emacs-devel))))
> 
> And restart c-ts-mode, and DEFUN’s should look normal now.

I will try that when I have time, thanks.  But if this indeed works
well, why not do something similar to fix more warnings?  And why not
make this the default, instead of asking users to write mode hooks?



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4