Skip to content

Commit d4d8b2d

Browse files
author
Rit
authored
Merge pull request #4 from MinecraftCommands/5uso/main
Reorder comments within root
2 parents 86536c4 + 3fa10d9 commit d4d8b2d

File tree

5 files changed

+358
-295
lines changed

5 files changed

+358
-295
lines changed

mcfunction.tmLanguage

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<key>applyEndPatternLast</key>
2727
<integer>1</integer>
2828
<key>begin</key>
29-
<string>^\s*(#[&gt;!])(.+)$</string>
29+
<string>^\s*(#[&gt;!#])(.+)$</string>
3030
<key>beginCaptures</key>
3131
<dict>
3232
<key>1</key>
@@ -70,7 +70,7 @@
7070
</dict>
7171
</dict>
7272
<key>match</key>
73-
<string>#.*$</string>
73+
<string>^\s*#.*$</string>
7474
<key>name</key>
7575
<string>meta.comments</string>
7676
</dict>
@@ -222,6 +222,26 @@
222222
</dict>
223223
</array>
224224
</dict>
225+
<key>comments_inline</key>
226+
<dict>
227+
<key>patterns</key>
228+
<array>
229+
<dict>
230+
<key>captures</key>
231+
<dict>
232+
<key>0</key>
233+
<dict>
234+
<key>name</key>
235+
<string>comment.line.mcfunction</string>
236+
</dict>
237+
</dict>
238+
<key>match</key>
239+
<string>#.*$</string>
240+
<key>name</key>
241+
<string>meta.comments</string>
242+
</dict>
243+
</array>
244+
</dict>
225245
<key>literals</key>
226246
<dict>
227247
<key>patterns</key>
@@ -799,7 +819,7 @@
799819
</dict>
800820
</dict>
801821
<key>match</key>
802-
<string>[A-Za-z_\-\+]+</string>
822+
<string>[A-Za-z_]+[A-Za-z_\-\+]*</string>
803823
<key>name</key>
804824
<string>meta.property_key</string>
805825
</dict>
@@ -881,13 +901,17 @@
881901
<key>include</key>
882902
<string>#literals</string>
883903
</dict>
904+
<dict>
905+
<key>include</key>
906+
<string>#comments</string>
907+
</dict>
884908
<dict>
885909
<key>include</key>
886910
<string>#names</string>
887911
</dict>
888912
<dict>
889913
<key>include</key>
890-
<string>#comments</string>
914+
<string>#comments_inline</string>
891915
</dict>
892916
<dict>
893917
<key>include</key>

mcfunction.tmLanguage.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@
1717
{
1818
"include": "#literals"
1919
},
20+
{
21+
"include": "#comments"
22+
},
2023
{
2124
"include": "#names"
2225
},
2326
{
24-
"include": "#comments"
27+
"include": "#comments_inline"
2528
},
2629
{
2730
"include": "#subcommands"
@@ -41,7 +44,7 @@
4144
"patterns": [
4245
{
4346
"applyEndPatternLast": 1,
44-
"begin": "^\\s*(#[>!])(.+)$",
47+
"begin": "^\\s*(#[>!#])(.+)$",
4548
"beginCaptures": {
4649
"1": {
4750
"name": "comment.block.mcfunction"
@@ -63,6 +66,19 @@
6366
}
6467
]
6568
},
69+
{
70+
"captures": {
71+
"0": {
72+
"name": "comment.line.mcfunction"
73+
}
74+
},
75+
"match": "^\\s*#.*$",
76+
"name": "meta.comments"
77+
}
78+
]
79+
},
80+
"comments_inline": {
81+
"patterns": [
6682
{
6783
"captures": {
6884
"0": {

0 commit comments

Comments
 (0)