mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 22:24:04 +02:00
add queries for go, javascript, extend toml queries (#212)
* extend toml queries * add javascript queries * add go queries
This commit is contained in:
parent
55d459e36e
commit
a7463ae4a5
4 changed files with 33 additions and 2 deletions
|
@ -36,6 +36,8 @@ use 'nvim-treesitter/nvim-treesitter-context'
|
|||
- [x] `cpp`
|
||||
- [x] `typescript`
|
||||
- [x] `rust`
|
||||
- [X] `go`
|
||||
- [X] `javascript`
|
||||
- [x] `json`
|
||||
- [x] `lua`
|
||||
- [x] `markdown`
|
||||
|
@ -90,7 +92,6 @@ use 'nvim-treesitter/nvim-treesitter-context'
|
|||
- [ ] `gleam`
|
||||
- [ ] `glimmer`
|
||||
- [ ] `glsl`
|
||||
- [ ] `go`
|
||||
- [ ] `godot_resource`
|
||||
- [ ] `gomod`
|
||||
- [ ] `gosum`
|
||||
|
@ -109,7 +110,6 @@ use 'nvim-treesitter/nvim-treesitter-context'
|
|||
- [ ] `http`
|
||||
- [ ] `ini`
|
||||
- [ ] `java`
|
||||
- [ ] `javascript`
|
||||
- [ ] `jq`
|
||||
- [ ] `jsdoc`
|
||||
- [ ] `json5`
|
||||
|
|
9
queries/go/context.scm
Normal file
9
queries/go/context.scm
Normal file
|
@ -0,0 +1,9 @@
|
|||
([
|
||||
(method_declaration)
|
||||
(function_declaration)
|
||||
(var_declaration)
|
||||
(type_declaration)
|
||||
(import_declaration)
|
||||
(if_statement)
|
||||
(const_declaration)
|
||||
] @context)
|
19
queries/javascript/context.scm
Normal file
19
queries/javascript/context.scm
Normal file
|
@ -0,0 +1,19 @@
|
|||
(if_statement
|
||||
consequence: (_) @context.end
|
||||
) @context
|
||||
|
||||
([
|
||||
(class_declaration)
|
||||
(function_declaration)
|
||||
(lexical_declaration)
|
||||
(method_definition)
|
||||
(arrow_function)
|
||||
(else_clause)
|
||||
(while_statement)
|
||||
(expression_statement)
|
||||
(jsx_element)
|
||||
(jsx_self_closing_element)
|
||||
(call_expression)
|
||||
(object)
|
||||
(pair)
|
||||
] @context)
|
|
@ -1,5 +1,8 @@
|
|||
|
||||
([
|
||||
(table)
|
||||
(table_array_element)
|
||||
(inline_table)
|
||||
(array)
|
||||
(pair)
|
||||
] @context)
|
||||
|
|
Loading…
Reference in a new issue