Skip to content

Commit 0835ea7

Browse files
authored
fix: patch 1.5.3 (#30)
* fix: patch highlighting of serialization formats and remove of invalid properties * feat: highlight `asm` as a keyword * chore: update links to documentation pages for entities introduced in 1.4.0 and 1.5.0 Tact versions
1 parent f5bdaf6 commit 0835ea7

File tree

5 files changed

+68
-50
lines changed

5 files changed

+68
-50
lines changed

package/Tact.sublime-completions

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
{
1818
"trigger": "asm\tasm with optional arrangement (...)",
1919
"contents": "asm $0",
20-
"kind": ["function", "a", "Attribute"]
20+
"kind": ["function", "a", "Attribute"],
21+
"details": "<a href=\"https://docs.tact-lang.org/book/assembly-functions\">Tact Docs</a>"
2122
},
2223

2324
// Literals, Base trait and constants
@@ -108,7 +109,8 @@
108109
{
109110
"trigger": "SendOnlyEstimateFee\tequal to 1024",
110111
"contents": "SendOnlyEstimateFee",
111-
"kind": ["variable", "c", "Constant"]
112+
"kind": ["variable", "c", "Constant"],
113+
"details": "<a href=\"https://docs.tact-lang.org/book/message-mode#base-modes\">Tact Docs</a>"
112114
},
113115
{
114116
"trigger": "ReserveExact\tequal to 0",
@@ -163,12 +165,14 @@
163165
{
164166
"trigger": "StdAddress",
165167
"contents": "StdAddress",
166-
"kind": ["variable", "s", "Struct"]
168+
"kind": ["variable", "s", "Struct"],
169+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#parsestdaddress\">Tact Docs</a>"
167170
},
168171
{
169172
"trigger": "VarAddress",
170173
"contents": "VarAddress",
171-
"kind": ["variable", "s", "Struct"]
174+
"kind": ["variable", "s", "Struct"],
175+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#parsevaraddress\">Tact Docs</a>"
172176
},
173177

174178
// Built-in types and serialization options
@@ -630,22 +634,26 @@
630634
{
631635
"trigger": "slice\tSlice from a BoC String at compile-time",
632636
"contents": "slice(${1:bocBase64String})",
633-
"kind": "function"
637+
"kind": "function",
638+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-comptime#slice\">Tact Docs</a>"
634639
},
635640
{
636641
"trigger": "rawSlice\tSlice from a String at compile-time",
637642
"contents": "rawSlice(${1:someString})",
638-
"kind": "function"
643+
"kind": "function",
644+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-comptime#rawslice\">Tact Docs</a>"
639645
},
640646
{
641-
"trigger": "ascii\tInt sum of ASCII values at compile-time",
647+
"trigger": "ascii\tInt of hex of ASCII characters at compile-time",
642648
"contents": "aslii(${1:asciiString})",
643-
"kind": "function"
649+
"kind": "function",
650+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-comptime#ascii\">Tact Docs</a>"
644651
},
645652
{
646653
"trigger": "crc32\tCRC32 of a String at compile-time",
647654
"contents": "crc32(${1:someString})",
648-
"kind": "function"
655+
"kind": "function",
656+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-comptime#crc32\">Tact Docs</a>"
649657
},
650658

651659
// Core library: Debug
@@ -694,12 +702,14 @@
694702
{
695703
"trigger": "parseStdAddress\tparse StdAddress from a Slice",
696704
"contents": "parseStdAddress(${1:slice_Slice})",
697-
"kind": "function"
705+
"kind": "function",
706+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#parsestdaddress\">Tact Docs</a>"
698707
},
699708
{
700709
"trigger": "parseVarAddress\tparse VarAddress from a Slice",
701710
"contents": "parseVarAddress(${1:slice_Slice})",
702-
"kind": "function"
711+
"kind": "function",
712+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#parsevaraddress\">Tact Docs</a>"
703713
},
704714

705715
// Core library: Random
@@ -868,66 +878,70 @@
868878
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativerandominterval\">Tact Docs</a>"
869879
},
870880
{
871-
"trigger": "nativeSendMessage\tsend message Cell with mode Int",
872-
"contents": "nativeSendMessage(${1:cell}, ${2:mode_Int})",
881+
"trigger": "nativeSendMessage\tsend msg Cell with mode Int",
882+
"contents": "nativeSendMessage(${1:msg_Cell}, ${2:mode_Int})",
873883
"kind": "function",
874884
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativesendmessage\">Tact Docs</a>"
875885
},
876886
{
877-
"trigger": "nativeSendMessageReturnForwardFee\tsend message Cell with mode Int and get fees",
878-
"contents": "nativeSendMessageReturnForwardFee(${1:cell}, ${2:mode_Int})",
879-
"kind": "function"
887+
"trigger": "nativeSendMessageReturnForwardFee\tsend msg Cell with mode Int and get fees",
888+
"contents": "nativeSendMessageReturnForwardFee(${1:msg_Cell}, ${2:mode_Int})",
889+
"kind": "function",
890+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativesendmessagereturnforwardfee\">Tact Docs</a>"
880891
},
881892
{
882893
"trigger": "nativeReserve\treserve nanoToncoin amount Int with mode Int",
883894
"contents": "nativeReserve(${1:amount_Int}, ${2:mode_Int})",
884895
"kind": "function",
885896
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativereserve\">Tact Docs</a>"
886897
},
887-
{
888-
"trigger": "nativeReserve\treserve nanoToncoin amount Int with mode Int",
889-
"contents": "nativeReserve(${1:amount_Int}, ${2:mode_Int})",
890-
"kind": "function"
891-
},
892898
{
893899
"trigger": "gasConsumed\tget gas consumed so far",
894900
"contents": "gasConsumed()",
895-
"kind": "function"
901+
"kind": "function",
902+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#gasconsumed\">Tact Docs</a>"
896903
},
897904
{
898905
"trigger": "getComputeFee\tcalc compute cost in nanoToncoins",
899906
"contents": "getComputeFee(${1:gas_used_Int, ${2:is_masterchain_Bool})",
900-
"kind": "function"
907+
"kind": "function",
908+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#getcomputefee\">Tact Docs</a>"
901909
},
902910
{
903911
"trigger": "getStorageFee\tcalc storage fees in nanoToncoins",
904912
"contents": "getStorageFee(${1:cells_Int, ${2:bits_Int}, ${3:seconds_Int}, ${4:is_masterchain_Bool})",
905-
"kind": "function"
913+
"kind": "function",
914+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#getstoragefee\">Tact Docs</a>"
906915
},
907916
{
908917
"trigger": "getForwardFee\tcalc forward fees in nanoToncoins",
909918
"contents": "getForwardFee(${1:cells_Int, ${2:bits_Int}, ${3:is_masterchain_Bool})",
910-
"kind": "function"
919+
"kind": "function",
920+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#getforwardfee\">Tact Docs</a>"
911921
},
912922
{
913923
"trigger": "getSimpleComputeFee\tcalc extra compute cost in nanoToncoins",
914924
"contents": "getSimpleComputeFee(${1:gas_used_Int, ${2:is_masterchain_Bool})",
915-
"kind": "function"
925+
"kind": "function",
926+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#getsimplecomputefee\">Tact Docs</a>"
916927
},
917928
{
918929
"trigger": "getSimpleForwardFee\tcalc extra forward fees in nanoToncoins",
919930
"contents": "getSimpleForwardFee(${1:cells_Int, ${2:bits_Int}, ${3:is_masterchain_Bool})",
920-
"kind": "function"
931+
"kind": "function",
932+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#getsimpleforwardfee\">Tact Docs</a>"
921933
},
922934
{
923935
"trigger": "getOriginalFwdFee\tcalc original fwd_fee in nanoToncoins",
924936
"contents": "getOriginalFwdFee(${1:fwd_fee_Int, ${2:is_masterchain_Bool})",
925-
"kind": "function"
937+
"kind": "function",
938+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#getoriginalfwdfee\">Tact Docs</a>"
926939
},
927940
{
928941
"trigger": "myStorageDue\tstorage fee debt in nanoToncoins",
929-
"contents": "myStorageDue(${1:fwd_fee_Int, ${2:is_masterchain_Bool})",
930-
"kind": "function"
942+
"contents": "myStorageDue()",
943+
"kind": "function",
944+
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced/#mystoragedue\">Tact Docs</a>"
931945
},
932946
]
933947
}

package/Tact.tmLanguage

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44
<dict>
55
<key>name</key>
66
<string>Tact</string>
7-
<key>displayName</key>
8-
<string>Tact</string>
97
<key>scopeName</key>
108
<string>source.tact</string>
119
<key>fileTypes</key>
1210
<array>
1311
<string>tact</string>
1412
</array>
15-
<key>foldingStartMarker</key>
16-
<string>\{\s*$</string>
17-
<key>foldingStopMarker</key>
18-
<string>^\s*\}</string>
1913
<key>patterns</key>
2014
<array>
2115
<dict>
@@ -128,7 +122,7 @@
128122
<key>todo</key>
129123
<dict>
130124
<key>match</key>
131-
<string>(?i)\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG)\b(?-i)</string>
125+
<string>\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG)\b</string>
132126
<key>name</key>
133127
<string>keyword.comment.todo.tact</string>
134128
</dict>
@@ -222,7 +216,7 @@
222216
<key>1</key>
223217
<dict>
224218
<key>name</key>
225-
<string>entity.other.attribute-name.tact</string>
219+
<string>keyword.other.asm.tact</string>
226220
</dict>
227221
<key>2</key>
228222
<dict>
@@ -274,10 +268,18 @@
274268
<key>comment</key>
275269
<string>Fallback match</string>
276270
<key>match</key>
277-
<string>(?&lt;!\.)\b(@name|@interface|asm)\b</string>
271+
<string>(?&lt;!\.)\b(@name|@interface)\b</string>
278272
<key>name</key>
279273
<string>entity.other.attribute-name.tact</string>
280274
</dict>
275+
<dict>
276+
<key>comment</key>
277+
<string>Fallback match</string>
278+
<key>match</key>
279+
<string>(?&lt;!\.)\b(asm)\b</string>
280+
<key>name</key>
281+
<string>keyword.other.asm.tact</string>
282+
</dict>
281283
</array>
282284
</dict>
283285
<key>literal</key>
@@ -617,7 +619,7 @@
617619
<array>
618620
<dict>
619621
<key>match</key>
620-
<string>(?&lt;!\.)\b(as)\s+(coins|remaining|bytes32|bytes64|int257|u?int(?:2[0-5][0-6]|1[0-9][0-9]|[1-9][0-9]?))\b</string>
622+
<string>(?&lt;!\.)\b(as)\s+(coins|remaining|bytes(?:32|64)|int257|u?int(?:25[0-6]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?))\b</string>
621623
<key>captures</key>
622624
<dict>
623625
<key>1</key>
@@ -929,4 +931,4 @@
929931
</dict>
930932
</dict>
931933
</dict>
932-
</plist>
934+
</plist>

package/Tact.tmLanguage.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
{
22
"name": "Tact",
3-
"displayName": "Tact",
43
"scopeName": "source.tact",
54
"fileTypes": [
65
"tact"
76
],
8-
"foldingStartMarker": "\\{\\s*$",
9-
"foldingStopMarker": "^\\s*\\}",
107
"patterns": [
118
{
129
"include": "#comment"
@@ -84,7 +81,7 @@
8481
},
8582

8683
"todo": {
87-
"match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG)\\b(?-i)",
84+
"match": "\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG)\\b",
8885
"name": "keyword.comment.todo.tact"
8986
},
9087

@@ -143,7 +140,7 @@
143140
"begin": "(?<!\\.)(asm)\\s*(\\()",
144141
"beginCaptures": {
145142
"1": {
146-
"name": "entity.other.attribute-name.tact"
143+
"name": "keyword.other.asm.tact"
147144
},
148145
"2": {
149146
"name": "punctuation.brackets.round.tact"
@@ -177,8 +174,13 @@
177174
},
178175
{
179176
"comment": "Fallback match",
180-
"match": "(?<!\\.)\\b(@name|@interface|asm)\\b",
177+
"match": "(?<!\\.)\\b(@name|@interface)\\b",
181178
"name": "entity.other.attribute-name.tact"
179+
},
180+
{
181+
"comment": "Fallback match",
182+
"match": "(?<!\\.)\\b(asm)\\b",
183+
"name": "keyword.other.asm.tact"
182184
}
183185
]
184186
},
@@ -402,7 +404,7 @@
402404
"comment": "Serialization",
403405
"patterns": [
404406
{
405-
"match": "(?<!\\.)\\b(as)\\s+(coins|remaining|bytes32|bytes64|int257|u?int(?:2[0-5][0-6]|1[0-9][0-9]|[1-9][0-9]?))\\b",
407+
"match": "(?<!\\.)\\b(as)\\s+(coins|remaining|bytes(?:32|64)|int257|u?int(?:25[0-6]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?))\\b",
406408
"captures": {
407409
"1": {
408410
"name": "keyword.other.as.tact storage.modifier.tact"

tests/syntax_test_import.tact

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "@stdlib/deploy";
77
// ^ string.quoted.double.tact punctuation.definition.string.end.tact
88
// ^ punctuation.semi.tact
99

10-
// comment
10+
// NOTE: comment
1111
// <- comment.line.double-slash.tact punctuation.definition.comment.line.double-slash.tact
1212

1313
/* multi-line comment/doc-string */

tests/syntax_test_struct.tact

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct Serialization {
7979
// ^^^^^^ entity.name.type.tact
8080
f7: Int as uint200;
8181
// ^^^^^^^ entity.name.type.tact
82-
f8: Int as int200;
82+
f8: Int as int249;
8383
// ^^^^^^ entity.name.type.tact
8484
f9: Int as uint256;
8585
// ^^^^^^^ entity.name.type.tact

0 commit comments

Comments
 (0)