diff --git a/crates/languages/src/python/highlights.scm b/crates/languages/src/python/highlights.scm index c31b64b10c..df6b60466c 100644 --- a/crates/languages/src/python/highlights.scm +++ b/crates/languages/src/python/highlights.scm @@ -1,6 +1,25 @@ +(parameter (identifier) @variable) (attribute attribute: (identifier) @property) (type (identifier) @type) +; Module imports + +(import_statement + (dotted_name (identifier) @type)) + +(import_statement + (aliased_import + name: (dotted_name (identifier) @type) + alias: (identifier) @type)) + +(import_from_statement + (dotted_name (identifier) @type)) + +(import_from_statement + (aliased_import + name: (dotted_name (identifier) @type) + alias: (identifier) @type)) + ; Function calls (decorator) @function @@ -44,9 +63,13 @@ (float) ] @number -; Variables -(assignment - left: (identifier) @variable) +; Self references + +[ + (parameters (identifier) @variable.special) + (attribute (identifier) @variable.special) + (#match? @variable.special "^self$") +] (comment) @comment (string) @string