From 8a74ac9aead72ef7a870908f1517b48f2bb25ac7 Mon Sep 17 00:00:00 2001 From: Omar Valdez Date: Mon, 28 Oct 2024 23:45:33 -0700 Subject: feat(python): highlight modules --- queries/python/highlights.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'queries/python') diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 2363dc323..77edc7960 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -310,7 +310,7 @@ (future_import_statement "from" @keyword.import - "__future__" @constant.builtin) + "__future__" @module.builtin) (import_from_statement "from" @keyword.import) @@ -323,6 +323,25 @@ (wildcard_import "*" @character.special) +(import_statement + name: (dotted_name + (identifier) @module)) + +(import_statement + name: (aliased_import + name: (dotted_name + (identifier) @module) + alias: (identifier) @module)) + +(import_from_statement + module_name: (dotted_name + (identifier) @module)) + +(import_from_statement + module_name: (relative_import + (dotted_name + (identifier) @module))) + [ "if" "elif" -- cgit v1.2.3-70-g09d2