Skip to content

Commit 86ccbfd

Browse files
committed
Highlight class parameters as kwargs in Atom/VSCode/GH.
1 parent 11bcc65 commit 86ccbfd

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

grammars/MagicPython.cson

+1-1
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ repository:
11241124
'''
11251125
captures:
11261126
"1":
1127-
name: "entity.other.inherited-class.python variable.parameter.class.python"
1127+
name: "variable.parameter.class.python entity.other.inherited-class.python"
11281128
"2":
11291129
name: "keyword.operator.assignment.python"
11301130
"inheritance-identifier":

grammars/MagicPython.tmLanguage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@
17331733
<key>1</key>
17341734
<dict>
17351735
<key>name</key>
1736-
<string>entity.other.inherited-class.python variable.parameter.class.python</string>
1736+
<string>variable.parameter.class.python entity.other.inherited-class.python</string>
17371737
</dict>
17381738
<key>2</key>
17391739
<dict>

grammars/src/MagicPython.syntax.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,11 @@ repository:
895895
(?x)
896896
\b ([[:alpha:]_]\w*) \s*(=)(?!=)
897897
captures:
898-
'1': {name: entity.other.inherited-class.python
899-
variable.parameter.class.python}
898+
# "variable.parameter.class.python" scope is more important
899+
# and hence we specify it first to highlight class parameters
900+
# as kwargs in Atom/VSCode/GH.
901+
'1': {name: variable.parameter.class.python
902+
entity.other.inherited-class.python}
900903
'2': {name: keyword.operator.assignment.python}
901904

902905
inheritance-identifier:

0 commit comments

Comments
 (0)