ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Tact

by Novus Nota ST3

All-in-one package for Tact programming language

Details

Installs

  • Total 15
  • Win 5
  • Mac 7
  • Linux 3
Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

tact-sublime

Tact + Sublime Text

🚀 Adds syntax highlighting, folding, code snippets and miscellaneous support for the Tact programming language to Sublime Text 3* and onward.

⚡ 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.

Features

TL;DR? Jump straight to the installation!

✨ Syntax highlighting

Light theme screenshot Dark theme screenshot

Color schemes on these screenshots: One Light | One Dark

This package features a comprehensive TextMate grammar for Tact, 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 and in GitHub Actions CI, and it also plays well with Shiki syntax highlighter.

✍ Auto-completions and ⌨ Code snippets

Feature: Auto-completions and Code snippets

Completions for:

  • Various constants, global static functions and Structs from the core library. Note, that all of the static functions complete with their expected arguments!
  • Literals, such as true or null
  • Keywords, such as return or while
  • Built-in types, such as Bool or map<K, V>
  • Serialization types, like uint8 or coins
  • …and more!

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!

Apart from completions, this package also provides a bunch of larger code snippets:

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

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.

✔ Syntax checks

Feature: Syntax checks

In any Tact project with node_modules involved, you can:

  1. Open the command palette (Ctrl/Cmd+Shift+P)
  2. Select Build With: Tact,

which will run syntax and type checking on the currently edited .tact file.

🗒 Symbol lists

Feature: Symbol lists

Use Ctrl/Cmd+r for opening and searching symbol lists in the current file.

👉 Indentation

Feature: Indentation

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.

{...} Folding

Feature: Folding

Freely collapse and expand chunks of your code in-between braces {} or parentheses ().

💭 Comments

Feature: Comments

Use Ctrl/Cmd+/ for a single-line comment toggle and Ctrl/Cmd+Shift+/ for multi-line comment toggle.

Installation

Through Package Control (Recommended)

This package is available on Package Control. To install it:

  1. Open the command palette (Ctrl/Cmd+Shift+P)
  2. Select Package Control: Install Package
  3. Select Tact

Manual installation

  1. Open the command palette (Ctrl/Cmd+Shift+P)
  2. Select Preferences: Browse Packages, this should open the “Packages” directory in your file explorer
  3. Clone this repo into that directory

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

LSP integration

When the language server supports it, LSP package enables improved autocomplete, go-to-definition, formatting, “hover docs”, compiler errors and warnings, general diagnostics and more.

To set it up, install the package and open its settings (Preferences: LSP Settings in the command palette), then add this config:

{
  "clients": {
    "Tact": {
      "enabled": true,
      "command": ["tact-extracted-ls", "--stdio"],
      "selector": "source.tact"
    }
  }
}

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):

{
  "clients": { /*...*/ },
  "inhibit_snippet_completions": true
}

Configurations above assume you have installed the Tact language server extracted from the tact-vscode. If not, run npm i -g tact-extracted-ls to install it.

To setup keyboard shortcuts for the language server, see: Key Bindings.

Compatibility

This package's syntax highlighting capabilities target Sublime Text 3+, while the rest of the features try to target the latest Sublime Text 4+. Bugs related to those features failing on any version lower that 4 won't be focused on.

Useful Tact links

Credits

Based on The Open Network.

Built with 🤍 by Novus Nota.

Contributing

When working on the grammar, do it in the JSON file. Then, convert it to Plist (XML) format using the following VSCode extension: tmLanguage.

Note, that color schemes greatly affect how the grammar looks like, and stick to commonly used capture names over trying to nail semantics with more specific ones.

License

MIT © Novus Nota.