mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -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
|
||||
type
|
||||
field
|
||||
doc for documentation adjecent to a definition. E.g.
|
||||
import for imported names
|
||||
doc for documentation adjacent to a definition. E.g.
|
||||
```
|
||||
|
||||
```scheme
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
name: (identifier) @definition)
|
||||
|
||||
(import_specifier
|
||||
(identifier) @definition)
|
||||
(identifier) @definition.import)
|
||||
|
||||
; References
|
||||
;------------
|
||||
|
|
|
|||
|
|
@ -8,6 +8,14 @@
|
|||
left: (expression_list
|
||||
(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
|
||||
(parameters
|
||||
(identifier) @definition.var)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue