mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
Introduce @definition.import for Python/Javascript
This commit is contained in:
parent
0e80b89935
commit
b6df2329bd
3 changed files with 11 additions and 2 deletions
|
|
@ -131,7 +131,8 @@ are optional and will not have any effect for now.
|
||||||
macro
|
macro
|
||||||
type
|
type
|
||||||
field
|
field
|
||||||
doc for documentation adjecent to a definition. E.g.
|
import for imported names
|
||||||
|
doc for documentation adjacent to a definition. E.g.
|
||||||
```
|
```
|
||||||
|
|
||||||
```scheme
|
```scheme
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
name: (identifier) @definition)
|
name: (identifier) @definition)
|
||||||
|
|
||||||
(import_specifier
|
(import_specifier
|
||||||
(identifier) @definition)
|
(identifier) @definition.import)
|
||||||
|
|
||||||
; References
|
; References
|
||||||
;------------
|
;------------
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,14 @@
|
||||||
left: (expression_list
|
left: (expression_list
|
||||||
(identifier) @definition.associated))))) @scope
|
(identifier) @definition.associated))))) @scope
|
||||||
|
|
||||||
|
; Imports
|
||||||
|
(aliased_import
|
||||||
|
alias: (identifier) @definition.import)
|
||||||
|
(import_statement
|
||||||
|
name: (dotted_name ((identifier) @definition.import)))
|
||||||
|
(import_from_statement
|
||||||
|
name: (dotted_name ((identifier) @definition.import)))
|
||||||
|
|
||||||
; Function with parameters, defines parameters
|
; Function with parameters, defines parameters
|
||||||
(parameters
|
(parameters
|
||||||
(identifier) @definition.var)
|
(identifier) @definition.var)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue