aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md3
-rw-r--r--queries/javascript/locals.scm2
-rw-r--r--queries/python/locals.scm8
3 files changed, 11 insertions, 2 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9b88e11bc..6d3288cb4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -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
diff --git a/queries/javascript/locals.scm b/queries/javascript/locals.scm
index d56000d5a..9a10db86d 100644
--- a/queries/javascript/locals.scm
+++ b/queries/javascript/locals.scm
@@ -29,7 +29,7 @@
name: (identifier) @definition)
(import_specifier
- (identifier) @definition)
+ (identifier) @definition.import)
; References
;------------
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)