on 0dde5f2 help sign in
helix/runtime/queries/python/highlights.scm
124 lines 1.8 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) @property)
33(type (identifier) @type)
35; Literals
38 (none)
39 (true)
40 (false)
41] @constant.builtin
44 (integer)
45 (float)
46] @number
48(comment) @comment
49(string) @string
50(escape_sequence) @escape
52(interpolation
53 "{" @punctuation.special
54 "}" @punctuation.special) @embedded
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 ">>"
85 "|"
86 "~"
87 "and"
88 "in"
89 "is"
90 "not"
91 "or"
92] @operator
95 "as"
96 "assert"
97 "async"
98 "await"
99 "break"
100 "class"
101 "continue"
102 "def"
103 "del"
104 "elif"
105 "else"
106 "except"
107 "exec"
108 "finally"
109 "for"
110 "from"
111 "global"
112 "if"
113 "import"
114 "lambda"
115 "nonlocal"
116 "pass"
117 "print"
118 "raise"
119 "return"
120 "try"
121 "while"
122 "with"
123 "yield"
124] @keyword