1
0
mirror of https://github.com/helix-editor/helix synced 2024-11-10 10:34:45 +01:00
helix/runtime/queries/ecma
2024-04-27 21:55:12 +02:00
..
highlights.scm Fixed ECMAScript private member highlighting (#10554) 2024-04-27 21:55:12 +02:00
indents.scm
injections.scm
locals.scm
README.md
textobjects.scm Add textobject for entries/elements of list-like things (#8150) 2024-03-31 11:53:15 -05:00

Inheritance model for ecma-based languages

Ecma-based languages share many traits. Because of this we want to share as many queries as possible while avoiding nested inheritance that can make query behaviour unpredictable due to unexpected precedence.

To achieve that, there are "public" and "private" versions for javascript, jsx, and typescript query files, that share the same name, but the "private" version name starts with an underscore (with the exception of ecma, that already exists as a sort of base "private" language). This allows the "private" versions to host the specific queries of the language excluding any ; inherits statement, in order to make them safe to be inherited by the "public" version of the same language and other languages as well. The tsx language doesn't have a "private" version given that currently it doesn't need to be inherited by other languages.

Language Inherits from
javascript _javascript, ecma
jsx _jsx, _javascript, ecma
typescript _typescript, ecma
tsx _jsx, _typescript, ecma

If you intend to add queries to any of the ecma-based languages above, make sure you add them to the correct private language they belong to, so that other languages down the line can benefit from them.