Add textobject for javascript (#3213)

This commit is contained in:
Erasin 2022-07-28 21:31:20 +08:00 committed by GitHub
parent cca83af3fd
commit 681c0a91dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 4 deletions

View file

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

View 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

View file

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

View file

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

View file

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

View file

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