Skip to content

Commit d78bdaa

Browse files
committed
Scope formatting placeholders similarly to Atom
1 parent 1ba703f commit d78bdaa

15 files changed

+72
-72
lines changed

Diff for: grammars/MagicPython.cson

+3-3
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ repository:
801801
name: "constant.language.python"
802802
match: "\\\\$"
803803
"string-formatting":
804-
name: "constant.character.format.python"
804+
name: "constant.character.format.placeholder.other.python"
805805
match: '''
806806
(?x)
807807
% (\\([\\w\\s]*\\))?
@@ -814,7 +814,7 @@ repository:
814814
"string-brace-formatting":
815815
patterns: [
816816
{
817-
name: "constant.character.format.python"
817+
name: "constant.character.format.placeholder.other.python"
818818
match: '''
819819
(?x)
820820
(?:
@@ -836,7 +836,7 @@ repository:
836836
name: "support.other.format.python"
837837
}
838838
{
839-
name: "constant.character.format.python"
839+
name: "constant.character.format.placeholder.other.python"
840840
begin: '''
841841
(?x)
842842
\\{

Diff for: grammars/MagicPython.syntax.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ repository:
569569
match: \\$
570570

571571
string-formatting:
572-
name: constant.character.format.python
572+
name: constant.character.format.placeholder.other.python
573573
match: |
574574
(?x)
575575
% (\([\w\s]*\))?
@@ -580,7 +580,7 @@ repository:
580580
581581
string-brace-formatting:
582582
patterns:
583-
- name: constant.character.format.python
583+
- name: constant.character.format.placeholder.other.python
584584
match: |
585585
(?x)
586586
(?:
@@ -596,7 +596,7 @@ repository:
596596
captures:
597597
'2': {name: storage.type.format.python}
598598
'3': {name: support.other.format.python}
599-
- name: constant.character.format.python
599+
- name: constant.character.format.placeholder.other.python
600600
begin: |
601601
(?x)
602602
\{

Diff for: grammars/MagicPython.tmLanguage

+3-3
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@
13041304
<key>string-formatting</key>
13051305
<dict>
13061306
<key>name</key>
1307-
<string>constant.character.format.python</string>
1307+
<string>constant.character.format.placeholder.other.python</string>
13081308
<key>match</key>
13091309
<string>(?x)
13101310
% (\([\w\s]*\))?
@@ -1320,7 +1320,7 @@
13201320
<array>
13211321
<dict>
13221322
<key>name</key>
1323-
<string>constant.character.format.python</string>
1323+
<string>constant.character.format.placeholder.other.python</string>
13241324
<key>match</key>
13251325
<string>(?x)
13261326
(?:
@@ -1350,7 +1350,7 @@
13501350
</dict>
13511351
<dict>
13521352
<key>name</key>
1353-
<string>constant.character.format.python</string>
1353+
<string>constant.character.format.placeholder.other.python</string>
13541354
<key>begin</key>
13551355
<string>(?x)
13561356
\{

Diff for: misc/scopes

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ comment.typehint.puctuation.notation.python
66
comment.typehint.type.notation.python
77
comment.typehint.variable.notation.python
88
constant.character.escape.regexp
9-
constant.character.format.python
9+
constant.character.format.placeholder.other.python
1010
constant.character.python
1111
constant.character.set.regexp
1212
constant.character.unicode.regexp

Diff for: test/strings/format1.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
= : keyword.operator.assignment.python, source.python
99
: source.python
1010
" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
11-
{0[ ] : constant.character.format.python, source.python, string.quoted.single.python
12-
:X>+10d : constant.character.format.python, source.python, string.quoted.single.python, support.other.format.python
13-
} : constant.character.format.python, source.python, string.quoted.single.python
11+
{0[ ] : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
12+
:X>+10d : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python, support.other.format.python
13+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
1414
" : punctuation.definition.string.end.python, source.python, string.quoted.single.python
1515
a : source.python
1616
= : keyword.operator.assignment.python, source.python
1717
: source.python
1818
" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
19-
{0[ ] : constant.character.format.python, source.python, string.quoted.single.python
20-
!s : constant.character.format.python, source.python, storage.type.format.python, string.quoted.single.python
21-
:X>+10d : constant.character.format.python, source.python, string.quoted.single.python, support.other.format.python
22-
} : constant.character.format.python, source.python, string.quoted.single.python
19+
{0[ ] : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
20+
!s : constant.character.format.placeholder.other.python, source.python, storage.type.format.python, string.quoted.single.python
21+
:X>+10d : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python, support.other.format.python
22+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
2323
" : punctuation.definition.string.end.python, source.python, string.quoted.single.python
2424
a : source.python
2525
= : keyword.operator.assignment.python, source.python
2626
: source.python
2727
" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
28-
{0[ ] : constant.character.format.python, source.python, string.quoted.single.python
29-
: : constant.character.format.python, source.python, string.quoted.single.python, support.other.format.python
30-
Xd>+10d : constant.character.format.python, source.python, string.quoted.single.python
31-
} : constant.character.format.python, source.python, string.quoted.single.python
28+
{0[ ] : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
29+
: : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python, support.other.format.python
30+
Xd>+10d : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
31+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
3232
" : punctuation.definition.string.end.python, source.python, string.quoted.single.python
3333
: source.python
3434
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python

Diff for: test/strings/format10.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
: source.python
1111
''' : punctuation.definition.string.begin.python, source.python, string.quoted.multi.python
1212
blah {foo-bar : source.python, string.quoted.multi.python
13-
%d : constant.character.format.python, source.python, string.quoted.multi.python
13+
%d : constant.character.format.placeholder.other.python, source.python, string.quoted.multi.python
1414
blah : source.python, string.quoted.multi.python
1515
{foo-bar : source.python, string.quoted.multi.python
16-
%d : constant.character.format.python, source.python, string.quoted.multi.python
16+
%d : constant.character.format.placeholder.other.python, source.python, string.quoted.multi.python
1717
} : source.python, string.quoted.multi.python
1818
blah {foo-bar : source.python, string.quoted.multi.python
19-
%d : constant.character.format.python, source.python, string.quoted.multi.python
19+
%d : constant.character.format.placeholder.other.python, source.python, string.quoted.multi.python
2020
//insane {}} : source.python, string.quoted.multi.python
2121
{}blah {foo-bar : source.python, string.quoted.multi.python
22-
%d : constant.character.format.python, source.python, string.quoted.multi.python
22+
%d : constant.character.format.placeholder.other.python, source.python, string.quoted.multi.python
2323
//insane {}} : source.python, string.quoted.multi.python
2424
''' : punctuation.definition.string.end.python, source.python, string.quoted.multi.python

Diff for: test/strings/format11.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
R : source.python, storage.type.string.python, string.quoted.raw.multi.python
1111
''' : punctuation.definition.string.begin.python, source.python, string.quoted.raw.multi.python
1212
\fr : source.python, string.quoted.raw.multi.python
13-
{still_ok} : constant.character.format.python, source.python, string.quoted.raw.multi.python
13+
{still_ok} : constant.character.format.placeholder.other.python, source.python, string.quoted.raw.multi.python
1414
ac : source.python, string.quoted.raw.multi.python
1515
{m_{j \rightarrow i}(\mathrm{good})} : source.python, string.quoted.raw.multi.python
1616
{not_ok} : source.python, string.quoted.raw.multi.python
17-
%d : constant.character.format.python, source.python, string.quoted.raw.multi.python
17+
%d : constant.character.format.placeholder.other.python, source.python, string.quoted.raw.multi.python
1818
''' : punctuation.definition.string.end.python, source.python, string.quoted.raw.multi.python

Diff for: test/strings/format12.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
' : punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python
1010
$\frac : source.python, string.quoted.raw.single.python
1111
{m_{j \ : source.python, string.quoted.raw.single.python
12-
%s : constant.character.format.python, source.python, string.quoted.raw.single.python
12+
%s : constant.character.format.placeholder.other.python, source.python, string.quoted.raw.single.python
1313
rightarrow i}(\mathrm{ : source.python, string.quoted.raw.single.python
14-
%s : constant.character.format.python, source.python, string.quoted.raw.single.python
14+
%s : constant.character.format.placeholder.other.python, source.python, string.quoted.raw.single.python
1515
good})}{\su%m{m_{j \rightarrow i}}}$ : source.python, string.quoted.raw.single.python
1616
' : punctuation.definition.string.end.python, source.python, string.quoted.raw.single.python

Diff for: test/strings/format2.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
: source.python
88
" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
99
normal : source.python, string.quoted.single.python
10-
{{ : constant.character.format.python, source.python, string.quoted.single.python
10+
{{ : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
1111
normal : source.python, string.quoted.single.python
12-
}} : constant.character.format.python, source.python, string.quoted.single.python
12+
}} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
1313
normal : source.python, string.quoted.single.python
14-
{10 : constant.character.format.python, source.python, string.quoted.single.python
15-
!r : constant.character.format.python, source.python, storage.type.format.python, string.quoted.single.python
16-
} : constant.character.format.python, source.python, string.quoted.single.python
14+
{10 : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
15+
!r : constant.character.format.placeholder.other.python, source.python, storage.type.format.python, string.quoted.single.python
16+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
1717
normal : source.python, string.quoted.single.python
18-
{fo.__add__ : constant.character.format.python, source.python, string.quoted.single.python
19-
!s : constant.character.format.python, source.python, storage.type.format.python, string.quoted.single.python
20-
} : constant.character.format.python, source.python, string.quoted.single.python
18+
{fo.__add__ : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
19+
!s : constant.character.format.placeholder.other.python, source.python, storage.type.format.python, string.quoted.single.python
20+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
2121
" : punctuation.definition.string.end.python, source.python, string.quoted.single.python
2222
. : source.python
2323
format : meta.function-call.generic.python, meta.function-call.python, source.python

Diff for: test/strings/format3.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
= : keyword.operator.assignment.python, source.python
1010
: source.python
1111
' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
12-
%i : constant.character.format.python, source.python, string.quoted.single.python
12+
%i : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
1313
' : punctuation.definition.string.end.python, source.python, string.quoted.single.python
1414
: source.python
1515
% : keyword.operator.arithmetic.python, source.python
@@ -19,28 +19,28 @@
1919
= : keyword.operator.assignment.python, source.python
2020
: source.python
2121
" : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
22-
%(language)s : constant.character.format.python, source.python, string.quoted.single.python
22+
%(language)s : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
2323
has : source.python, string.quoted.single.python
24-
%(number)03d : constant.character.format.python, source.python, string.quoted.single.python
24+
%(number)03d : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
2525
quote types. : source.python, string.quoted.single.python
2626
" : punctuation.definition.string.end.python, source.python, string.quoted.single.python
2727
a : source.python
2828
= : keyword.operator.assignment.python, source.python
2929
: source.python
3030
b : source.python, storage.type.string.python, string.quoted.binary.single.python
3131
" : punctuation.definition.string.begin.python, source.python, string.quoted.binary.single.python
32-
%(language)s : constant.character.format.python, source.python, string.quoted.binary.single.python
32+
%(language)s : constant.character.format.placeholder.other.python, source.python, string.quoted.binary.single.python
3333
has : source.python, string.quoted.binary.single.python
34-
%(number)03d : constant.character.format.python, source.python, string.quoted.binary.single.python
34+
%(number)03d : constant.character.format.placeholder.other.python, source.python, string.quoted.binary.single.python
3535
quote types. : source.python, string.quoted.binary.single.python
3636
" : punctuation.definition.string.end.python, source.python, string.quoted.binary.single.python
3737
a : source.python
3838
= : keyword.operator.assignment.python, source.python
3939
: source.python
4040
R : source.python, storage.type.string.python, string.quoted.raw.single.python
4141
" : punctuation.definition.string.begin.python, source.python, string.quoted.raw.single.python
42-
%(language)s : constant.character.format.python, source.python, string.quoted.raw.single.python
42+
%(language)s : constant.character.format.placeholder.other.python, source.python, string.quoted.raw.single.python
4343
has : source.python, string.quoted.raw.single.python
44-
%(number)03d : constant.character.format.python, source.python, string.quoted.raw.single.python
44+
%(number)03d : constant.character.format.placeholder.other.python, source.python, string.quoted.raw.single.python
4545
quote types. : source.python, string.quoted.raw.single.python
4646
" : punctuation.definition.string.end.python, source.python, string.quoted.raw.single.python

Diff for: test/strings/format4.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
: source.python
1010
' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
1111
qqq : source.python, string.quoted.single.python
12-
{ : constant.character.format.python, source.python, string.quoted.single.python
13-
: : constant.character.format.python, source.python, string.quoted.single.python, support.other.format.python
14-
%Y-%m-%d %H:%M:%S : constant.character.format.python, source.python, string.quoted.single.python
15-
} : constant.character.format.python, source.python, string.quoted.single.python
12+
{ : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
13+
: : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python, support.other.format.python
14+
%Y-%m-%d %H:%M:%S : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
15+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
1616
www : source.python, string.quoted.single.python
1717
' : punctuation.definition.string.end.python, source.python, string.quoted.single.python
1818
a : source.python
1919
= : keyword.operator.assignment.python, source.python
2020
: source.python
2121
' : punctuation.definition.string.begin.python, source.python, string.quoted.single.python
2222
qqq : source.python, string.quoted.single.python
23-
{0 : constant.character.format.python, source.python, string.quoted.single.python
24-
: : constant.character.format.python, source.python, string.quoted.single.python, support.other.format.python
25-
{fill} : constant.character.format.python, source.python, string.quoted.single.python
26-
{align} : constant.character.format.python, source.python, string.quoted.single.python
27-
16 : constant.character.format.python, source.python, string.quoted.single.python
28-
} : constant.character.format.python, source.python, string.quoted.single.python
23+
{0 : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
24+
: : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python, support.other.format.python
25+
{fill} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
26+
{align} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
27+
16 : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
28+
} : constant.character.format.placeholder.other.python, source.python, string.quoted.single.python
2929
www : source.python, string.quoted.single.python
3030
' : punctuation.definition.string.end.python, source.python, string.quoted.single.python

0 commit comments

Comments
 (0)