on 9bfb0ca help sign in
helix/runtime/queries/python/highlights.scm
121 lines 1.9 kB history raw
1; Identifier naming conventions
3((identifier) @constructor
4 (#match? @constructor "^[A-Z]"))
6((identifier) @constant
7 (#match? @constant "^[A-Z][A-Z_]*$"))
9; Builtin functions
11((call
12 function: (identifier) @function.builtin)
13 (#match?
14 @function.builtin
15 "^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$"))
17; Function calls
19(decorator) @function
21(call
22 function: (attribute attribute: (identifier) @function.method))
23(call
24 function: (identifier) @function)
26; Function definitions
28(function_definition
29 name: (identifier) @function)
31(identifier) @variable
32(attribute attribute: (identifier) @variable.other.member)
33(type (identifier) @type)
35; Literals
38 (none)
39 (true)
40 (false)
41] @constant.builtin
43(integer) @constant.numeric.integer
44(float) @constant.numeric.float
45(comment) @comment
46(string) @string
47(escape_sequence) @constant.character.escape
49(interpolation
50 "{" @punctuation.special
51 "}" @punctuation.special) @embedded
54 "-"
55 "-="
56 "!="
57 "*"
58 "**"
59 "**="
60 "*="
61 "/"
62 "//"
63 "//="
64 "/="
65 "&"
66 "%"
67 "%="
68 "^"
69 "+"
70 "->"
71 "+="
72 "<"
73 "<<"
74 "<="
75 "<>"
76 "="
77 ":="
78 "=="
79 ">"
80 ">="
81 ">>"
82 "|"
83 "~"
84 "and"
85 "in"
86 "is"
87 "not"
88 "or"
89] @operator
92 "as"
93 "assert"
94 "async"
95 "await"
96 "break"
97 "class"
98 "continue"
99 "def"
100 "del"
101 "elif"
102 "else"
103 "except"
104 "exec"
105 "finally"
106 "for"
107 "from"
108 "global"
109 "if"
110 "import"
111 "lambda"
112 "nonlocal"
113 "pass"
114 "print"
115 "raise"
116 "return"
117 "try"
118 "while"
119 "with"
120 "yield"
121] @keyword