Add textobject for javascript (#3213)

imgbot
Erasin 2 years ago committed by GitHub
parent cca83af3fd
commit 681c0a91dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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` |

@ -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

@ -0,0 +1 @@
; inherits: javascript

@ -0,0 +1 @@
; inherits: typescript

@ -0,0 +1 @@
; inherits: typescript,jsx

@ -0,0 +1,8 @@
; inherits: javascript
[
(interface_declaration
body:(_) @class.inside)
(type_alias_declaration
value: (_) @class.inside)
] @class.around
Loading…
Cancel
Save