emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree sitter: Should *-ts-modes derive from a common base?


From: Dmitry Gutov
Subject: Re: Tree sitter: Should *-ts-modes derive from a common base?
Date: Wed, 22 Mar 2023 09:32:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 21/03/2023 11:30, Phil Sainty wrote:
The case I've spotted thus far which wouldn't work is the CSS modes,
where we have this:

(define-derived-mode css-base-mode prog-mode "CSS"
(define-derived-mode css-mode css-base-mode "CSS"
(define-derived-mode css-ts-mode css-base-mode "CSS"

That could be refactored if this idea was a sensible one.

How would you refactor it? We don't have multiple inheritance.

Apologies if this has been discussed before... it seems like
something which might have come up, but I couldn't find anything
relevant.  I'm not across the tree-sitter work in general though,
and maybe this is a bad idea for some reason.

There's been a bunch of discussions on the bug tracker, and at least one where the participants landed on the xxx-base-mode design. I don't have the bug number at hand, though.



reply via email to

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