Skip to content

Commit b360d10

Browse files
authored
feat: update README (#11)
* WIP * done! * fix: using a picture over a vid and a small correction in snippets
1 parent 7698264 commit b360d10

11 files changed

+55
-53
lines changed

.github/media/banner.png

14.5 KB
Loading

.github/media/feature-checks.gif

740 KB
Loading

.github/media/feature-comments.gif

523 KB
Loading

.github/media/feature-completions.png

334 KB
Loading

.github/media/feature-folding.gif

1.08 MB
Loading

.github/media/feature-indentation.gif

1.45 MB
Loading

.github/media/feature-symbols.gif

752 KB
Loading

.github/media/screen-dark.png

132 KB
Loading

.github/media/screen-light.png

136 KB
Loading

README.md

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,94 @@
11
# tact-sublime
22

3-
<!--
4-
TODO: banner!
5-
-->
3+
<center>
4+
<img src=".github/media/banner.png" alt="Tact + Sublime Text"/>
5+
</center>
66

77
🚀 Adds syntax highlighting, folding, code snippets and miscellaneous support for the [Tact programming language](https://tact-lang.org/) to Sublime Text [3* and onward](#compatibility).
88

99
⚡ Tact is a new programming language for TON blockchain that is focused on efficiency and simplicity. It is designed to be easy to learn and use, and to be a good fit for smart contracts, because it is a statically typed language with a simple syntax and a powerful type system.
1010

1111
## Features
1212

13-
TL;DR? [Jump straight to the installation](#installation)!
14-
15-
### Syntax highlighting
13+
TL;DR? Jump straight to the [installation](#installation)!
1614

17-
<!-- [img] & [img] -->
15+
### ✨ Syntax highlighting
1816

19-
<!-- TODO: image previews
2017
<p>
21-
<img alt="light screenshot" title="Breakers" src="images/screen-light.png" width="45%">
22-
<img alt="dark screenshot" title="Mariana" src="images/screen-dark.png" width="45%">
18+
<img alt="Light theme screenshot" title="One Light" src=".github/media/screen-light.png" width="45%"/>
19+
<img alt="Dark theme screenshot" title="One Dark" src=".github/media/screen-dark.png" width="45%"/>
20+
<p>Color schemes on these screenshots: <i>One Light</i> | <i>One Dark</i></p>
2321
</p>
24-
-->
2522

26-
### Basic completions
23+
This package features a comprehensive [TextMate grammar for Tact](package/Tact.tmLanguage.json), which is used for syntax highlighting here in Sublime Text as well as in Tact docs, Nujan IDE and other places. It's thoroughly tested [locally](tests/) and in [GitHub Actions CI](.github/workflows/ci.yml), and it also plays well with [Shiki syntax highlighter](https://github.com/shikijs/shiki).
2724

28-
<!--
29-
[gif]
25+
### ✍ Auto-completions and ⌨ Code snippets
3026

31-
Description.
27+
<img src=".github/media/feature-completions.png" alt="Feature: Auto-completions and Code snippets"/>
3228

33-
For more, you may try: ...
34-
-->
29+
Completions for:
3530

36-
### Code snippets
31+
* Various constants, global static functions and Structs from the [core library](https://docs.tact-lang.org/ref). Note, that all of the static functions complete with their expected arguments!
32+
* Literals, such as `true` or `null`
33+
* Keywords, such as `return` or `while`
34+
* Built-in types, such as `Bool` or `map<K, V>`
35+
* Serialization types, like `uint8` or `coins`
36+
* ...and more!
3737

38-
<!--
39-
[gif]
38+
Nearly all of the completions have descriptive annotations and/or clickable links to corresponding explanatory pages in documentation. Just press on the "Tact Docs" link at the bottom of the completions window, and it will take you straight to the docs!
4039

41-
Description.
42-
-->
40+
Apart from completions, this package also provides a bunch of larger code snippets:
4341

44-
### Syntax checks
42+
1. Control flow related, like snippets for nested if-else-if or try-catch statements
43+
2. Import related, like `impdeploy`, which expands to the full import statement for `@stdlib/deploy`
44+
3. Various function declaration helpers, like `natfunction` for native functions or `init2` for initialization functions with two parameters
45+
4. Constant and variable declaration helpers, named `constant` and `variable` respectively
46+
5. A special `sendparams` snippet, which expands to `send(SendParameters{…})` with some values filled in for your convenience!
47+
6. ...and more!
4548

46-
<!--
47-
[gif]
49+
**Note**, that these completions and snippets aren't semantic, in the sense that they're not aware of code contexts (being inside of a function body or declaring a Struct, for example). To enable semantic completions, see the [language server setup](#lsp-integration).
4850

49-
Build: with Tact in the command palette
50-
-->
51+
### ✔ Syntax checks
5152

52-
### Symbol lists
53+
![Feature: Syntax checks](.github/media/feature-checks.gif)
5354

54-
<!--
55-
[gif]
55+
In any Tact project with `node_modules` involved, you can:
5656

57-
ctrl+r and other stuff
58-
-->
57+
1. Open the command palette (<kbd>Ctrl/Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>)
58+
2. Select **Build With: Tact**,
5959

60-
### Folding
60+
which will run syntax and type checking on the currently edited `.tact` file.
6161

62-
<!--
63-
[gif]
62+
### 🗒 Symbol lists
6463

65-
...
66-
-->
64+
![Feature: Symbol lists](.github/media/feature-symbols.gif)
6765

68-
### Indentation
66+
Use <kbd>Ctrl/Cmd</kbd>+<kbd>r</kbd> for opening and searching symbol lists in the current file.
6967

70-
<!--
71-
[gif]
68+
### 👉 Indentation
7269

73-
...
74-
-->
70+
![Feature: Indentation](.github/media/feature-indentation.gif)
7571

76-
### Comments
72+
Mostly accurate indentation support. Note, that this package doesn't come with a fully-fledged formatter, but it tries its utmost to deliver a pleasant editing experience nonetheless.
7773

78-
<!--
79-
[gif]
74+
### `{...}` Folding
8075

81-
ctrl+/ and ctrl+shift+/
82-
-->
76+
![Feature: Folding](.github/media/feature-folding.gif)
77+
78+
Freely collapse and expand chunks of your code in-between braces `{}` or parentheses `()`.
79+
80+
### 💭 Comments
81+
82+
![Feature: Comments](.github/media/feature-comments.gif)
83+
84+
Use <kbd>Ctrl/Cmd</kbd>+<kbd>/</kbd> for a single-line comment toggle and <kbd>Ctrl/Cmd</kbd>+<kbd>Shift</kbd>+<kbd>/</kbd> for multi-line comment toggle.
8385

8486
## Installation
8587

8688
<!-- TODO: Add to https://github.com/wbond/package_control_channel
8789
### Through Package Control (Recommended)
8890
89-
This package is available on [Package Control](https://packagecontrol.io/installation). To install:
91+
This package is available on [Package Control](https://packagecontrol.io/installation). To install it:
9092
9193
1. Open the command palette (<kbd>Ctrl/Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>)
9294
2. Select **Package Control: Install Package**
@@ -97,7 +99,7 @@ This package is available on [Package Control](https://packagecontrol.io/install
9799

98100
1. Open the command palette (<kbd>Ctrl/Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>)
99101
2. Select **Preferences: Browse Packages**, this should open the "Packages" directory in your file explorer
100-
3. Clone this repo into that directory.
102+
3. Clone this repo into that directory
101103

102104
Don't forget to run git pull from time to time to get the latest updates of this package.
103105

@@ -119,7 +121,7 @@ To set it up, install the package and open its settings (**Preferences: LSP Sett
119121
}
120122
```
121123

122-
Additionally, you can disable all snippets and suggestions provided by this plugin and leave everything to LSP. To do so, set `"inhibit_snippet_competions"` to `true` right after `"clients"` in the same settings (**Preferences: LSP Settings** in the command palette):
124+
Additionally, you can disable all snippets and suggestions provided by this (and other) packages and leave everything to LSPs. To do so, set `"inhibit_snippet_competions"` to `true` right after `"clients"` in the same settings (**Preferences: LSP Settings** in the command palette):
123125

124126
```json
125127
{

package/Tact.sublime-completions

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@
118118
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativereserve-base-modes\">Tact Docs</a>"
119119
},
120120
{
121-
"trigger": "ReserveAddOriginalBalanct\tequal to 4",
121+
"trigger": "ReserveAddOriginalBalance\tequal to 4",
122122
"contents": "ReserveAddOriginalBalance",
123123
"kind": ["variable", "c", "Constant"],
124124
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativereserve-optional-flags\">Tact Docs</a>"
125125
},
126126
{
127-
"trigger": "ReserveInvertSigt\tequal to 8",
127+
"trigger": "ReserveInvertSign\tequal to 8",
128128
"contents": "ReserveInvertSign",
129129
"kind": ["variable", "c", "Constant"],
130130
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativereserve-optional-flags\">Tact Docs</a>"
131131
},
132132
{
133-
"trigger": "ReserveBounceIfActionFait\tequal to 16",
133+
"trigger": "ReserveBounceIfActionFail\tequal to 16",
134134
"contents": "ReserveBounceIfActionFail",
135135
"kind": ["variable", "c", "Constant"],
136136
"details": "<a href=\"https://docs.tact-lang.org/ref/core-advanced#nativereserve-optional-flags\">Tact Docs</a>"

0 commit comments

Comments
 (0)