[Top][All Lists]

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

Re: Tree-sitter and major mode inheritance

From: Dmitry Gutov
Subject: Re: Tree-sitter and major mode inheritance
Date: Sat, 19 Nov 2022 23:39:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 19.11.2022 12:26, Eli Zaretskii wrote:
From: Yuan Fu<casouri@gmail.com>
Date: Sat, 19 Nov 2022 01:41:47 -0800
Cc: Stefan Monnier<monnier@iro.umontreal.ca>,
  Eli Zaretskii<eliz@gnu.org>,
  Theodor Thornhill<theo@thornhill.no>

Anyway, does anyone think this is a good/bad idea? Should I go implement this 
on css, js, c, etc? It can also be the other way around: instead of having 
c-mode being the virtual mode, we can leave c-mode as-is, and have a 
c-base-mode inherited by c-mode and c-ts-mode. And similarly rss-base-mode, 
rss-mode, and rss-ts-mode.
I'd prefer leaving the original modes as-is.  That should cause less
compatibility problems, I think.

Eli, what's your solution for the problem, then?

E.g. js-mode enables tree-sitter, and installs some stuff based on it.

But js2-mode inherits from js-mode (meaning, it will run the same setup code, and then some of its own), yet it has its own parser. Which will cause all sorts of conflicts with tree-sitter.

reply via email to

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