mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
Add textobject for javascript (#3213)
This commit is contained in:
parent
cca83af3fd
commit
681c0a91dc
@ -45,10 +45,10 @@
|
||||
| idris | | | | `idris2-lsp` |
|
||||
| iex | ✓ | | | |
|
||||
| java | ✓ | | | `jdtls` |
|
||||
| javascript | ✓ | | ✓ | `typescript-language-server` |
|
||||
| javascript | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| jsdoc | ✓ | | | |
|
||||
| json | ✓ | | ✓ | `vscode-json-language-server` |
|
||||
| jsx | ✓ | | ✓ | `typescript-language-server` |
|
||||
| jsx | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| julia | ✓ | | | `julia` |
|
||||
| kotlin | ✓ | | | `kotlin-language-server` |
|
||||
| latex | ✓ | | | `texlab` |
|
||||
@ -97,9 +97,9 @@
|
||||
| tfvars | | | | `terraform-ls` |
|
||||
| toml | ✓ | | | `taplo` |
|
||||
| tsq | ✓ | | | |
|
||||
| tsx | ✓ | | | `typescript-language-server` |
|
||||
| tsx | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| twig | ✓ | | | |
|
||||
| typescript | ✓ | | ✓ | `typescript-language-server` |
|
||||
| typescript | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| ungrammar | ✓ | | | |
|
||||
| v | ✓ | | | `vls` |
|
||||
| vala | ✓ | | | `vala-language-server` |
|
||||
|
36
runtime/queries/javascript/textobjects.scm
Normal file
36
runtime/queries/javascript/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
|
1
runtime/queries/jsx/textobjects.scm
Normal file
1
runtime/queries/jsx/textobjects.scm
Normal file
@ -0,0 +1 @@
|
||||
; inherits: javascript
|
1
runtime/queries/tsx/indents.scm
Normal file
1
runtime/queries/tsx/indents.scm
Normal file
@ -0,0 +1 @@
|
||||
; inherits: typescript
|
1
runtime/queries/tsx/textobjects.scm
Normal file
1
runtime/queries/tsx/textobjects.scm
Normal file
@ -0,0 +1 @@
|
||||
; inherits: typescript,jsx
|
8
runtime/queries/typescript/textobjects.scm
Normal file
8
runtime/queries/typescript/textobjects.scm
Normal file
@ -0,0 +1,8 @@
|
||||
; inherits: javascript
|
||||
|
||||
[
|
||||
(interface_declaration
|
||||
body:(_) @class.inside)
|
||||
(type_alias_declaration
|
||||
value: (_) @class.inside)
|
||||
] @class.around
|
Loading…
Reference in New Issue
Block a user