mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-05 20:07:44 +03:00
Inherit javascript/typescript from common 'ecma' queries (#3301)
JavaScript queries now contain a few lines that prevent them from being used whole-sale in typescript with `; inherits: javascript`. Here we follow nvim-treesitter's way of using a fake 'ecma' language as a common base for JavaScript and TypeScript to share as much as we can.
This commit is contained in:
parent
69f84e2516
commit
08b442f4cc
20 changed files with 359 additions and 353 deletions
36
runtime/queries/ecma/textobjects.scm
Normal file
36
runtime/queries/ecma/textobjects.scm
Normal file
|
@ -0,0 +1,36 @@
|
|||
(function_declaration
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(function
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(arrow_function
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(method_definition
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(generator_function_declaration
|
||||
body: (_) @function.inside) @function.around
|
||||
|
||||
(class_declaration
|
||||
body: (class_body) @class.inside) @class.around
|
||||
|
||||
(class
|
||||
(class_body) @class.inside) @class.around
|
||||
|
||||
(export_statement
|
||||
declaration: [
|
||||
(function_declaration) @function.around
|
||||
(class_declaration) @class.around
|
||||
])
|
||||
|
||||
(formal_parameters
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(arguments
|
||||
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
||||
|
||||
(comment) @comment.inside
|
||||
|
||||
(comment)+ @comment.around
|
Loading…
Add table
Add a link
Reference in a new issue