aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-07-08 15:18:28 +0200
committerThomas Vigouroux <39092278+vigoux@users.noreply.github.com>2020-07-08 18:00:35 +0200
commitb6df2329bd129290f857b59fd407d65a6ae437f8 (patch)
tree0cd2b75b9eb22b6eb873ac13e1c668d946408832 /queries/python
parentHighlight complete type definition (diff)
downloadnvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.tar
nvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.tar.gz
nvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.tar.bz2
nvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.tar.lz
nvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.tar.xz
nvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.tar.zst
nvim-treesitter-b6df2329bd129290f857b59fd407d65a6ae437f8.zip
Introduce @definition.import for Python/Javascript
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/locals.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/queries/python/locals.scm b/queries/python/locals.scm
index bcf1b1572..1deca18c9 100644
--- a/queries/python/locals.scm
+++ b/queries/python/locals.scm
@@ -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)