@@ -101,24 +101,6 @@ patterns:
101101- name : keyword.operator.assignment.python
102102 match : \=
103103
104- - include : ' #builtin_types'
105-
106- - include : ' #builtin_functions_name'
107-
108- - include : ' #builtin_functions_call'
109-
110- - include : ' #errors_warnings_exceptions'
111-
112- - include : ' #docstrings'
113-
114- - include : ' #magic_function_calls'
115-
116- - include : ' #magic_function_names'
117-
118- - include : ' #magic_variable_names'
119-
120- - include : ' #generic_object_names'
121-
122104- name : meta.class.old-style.python
123105 contentName : entity.name.type.class.python
124106 begin : \s*(class)\s+(?=[\p{Alpha}_][\p{Alnum}_]*\s*\:)
@@ -174,35 +156,6 @@ patterns:
174156 patterns :
175157 - include : ' #entity_name_function'
176158
177- - name : meta.function-call.python
178- begin : (?:\.)?((self|cls)|([\p{Alpha}_][\p{Alnum}_]*))\s*(?=(\())
179- beginCaptures :
180- ' 2 ' : {name: variable.parameter.function.language.python}
181- ' 3 ' : {name: meta.function-call.generic.python}
182- ' 4 ' : {name: punctuation.definition.arguments.begin.python}
183- end : (\))
184- endCaptures :
185- ' 1 ' : {name: punctuation.definition.arguments.end.python}
186- patterns :
187- - begin : (?=[\p{Alpha}_][\p{Alnum}_]*(?:\.[\p{Alpha}_][\p{Alnum}_]*)*\s*\()
188- end : (?=\s*\()
189- patterns :
190- - include : ' #dotted_name'
191- - contentName : meta.function-call.arguments.python
192- begin : (\()
193- beginCaptures :
194- ' 1 ' : {name: punctuation.definition.arguments.begin.python}
195- end : (?=(\)))
196- endCaptures :
197- ' 1 ' : {name: punctuation.definition.arguments.end.python}
198- patterns :
199- - include : ' #keyword_arguments'
200- - include : $self
201- - begin : \G
202- end : (?=\()
203- patterns :
204- - include : ' #dotted_name'
205-
206159- name : meta.function.python
207160 begin : \s*((?:async\s+)?def)\s+(?=[\p{Alpha}_][\p{Alnum}_]*\s*\()
208161 beginCaptures :
@@ -325,6 +278,66 @@ patterns:
325278 patterns :
326279 - include : ' #dotted_name'
327280
281+ - name : meta.function-call.python
282+ contentName : meta.function-call.arguments.python
283+ begin : (?<=\)|\])\s*(\()
284+ beginCaptures :
285+ ' 1 ' : {name: punctuation.definition.arguments.begin.python}
286+ end : (\))
287+ endCaptures :
288+ ' 1 ' : {name: punctuation.definition.arguments.end.python}
289+ patterns :
290+ - include : ' #keyword_arguments'
291+ - include : $self
292+
293+ - include : ' #builtin_types'
294+
295+ - include : ' #builtin_functions_name'
296+
297+ - include : ' #builtin_functions_call'
298+
299+ - include : ' #errors_warnings_exceptions'
300+
301+ - include : ' #docstrings'
302+
303+ - include : ' #magic_function_names'
304+
305+ - include : ' #magic_function_calls'
306+
307+ - include : ' #magic_variable_names'
308+
309+ - include : ' #language_variables'
310+
311+ - include : ' #generic_object_names'
312+
313+ - name : meta.function-call.python
314+ begin : (?:\.)?([\p{Alpha}_][\p{Alnum}_]*)\s*(?=(\())
315+ beginCaptures :
316+ ' 1 ' : {name: meta.function-call.generic.python}
317+ ' 2 ' : {name: punctuation.definition.arguments.begin.python}
318+ end : (\))
319+ endCaptures :
320+ ' 1 ' : {name: punctuation.definition.arguments.end.python}
321+ patterns :
322+ - begin : (?=[\p{Alpha}_][\p{Alnum}_]*(?:\.[\p{Alpha}_][\p{Alnum}_]*)*\s*\()
323+ end : (?=\s*\()
324+ patterns :
325+ - include : ' #dotted_name'
326+ - contentName : meta.function-call.arguments.python
327+ begin : (\()
328+ beginCaptures :
329+ ' 1 ' : {name: punctuation.definition.arguments.begin.python}
330+ end : (?=(\)))
331+ endCaptures :
332+ ' 1 ' : {name: punctuation.definition.arguments.end.python}
333+ patterns :
334+ - include : ' #keyword_arguments'
335+ - include : $self
336+ - begin : \G
337+ end : (?=\()
338+ patterns :
339+ - include : ' #dotted_name'
340+
328341- comment : Py2 print statement that should only be matched after function calls
329342 name : keyword.other.print.python
330343 match : (?<!\.)\b(print)(?=\s|$)
@@ -739,8 +752,9 @@ repository:
739752 - include : $self
740753
741754 language_variables :
742- name : variable.language.python
743- match : (?<!\.)\b(self|cls)\b
755+ match : (?<!\.)\b(self|cls)(?:\.|\()?
756+ captures :
757+ " 1 " : {name: variable.language.python}
744758
745759 line_continuation :
746760 match : (\\)(.*)$\n?
0 commit comments