Skip to main content
TON extension for Visual Studio Code (VS Code) and VSCode-based editors, such as VSCodium, Cursor, Windsurf, and others.

Installation

From Visual Studio Marketplace

Applicable for: VSCode
Extension on: Marketplace
  1. In the editor, open the Command Palette with Ctrl+Shift+P (or ⌘+⇧+P on macOS)
  2. Type and select Extensions: Install Extensions
  3. Search for TON
  4. Select the official extension from TON Core and click Install
The editor fetches and installs the extension. Restart the editor to apply changes if prompted. Here is how the extension page may look in VSCode, before pressing the Install button: Screenshot of extension installationScreenshot of extension installation

From Open VSX Registry

Applicable for: VSCodium, Cursor, Windsurf, and other VSCodium-based editors
Extension in: Registry
Installation steps are identical to the VSCode setup. Additionally, one can download the exact extension version from the Open VSX Registry and then proceed with installation from disk.

From disk

Applicable for: any VSCodium-based editor
VSIX file: latest GitHub release
To manually install the extension:
  1. Download the .vsix-packaged plugin archive from the latest GitHub release or from the exact version in the registry
  2. In the editor, open the Command Palette with Ctrl+Shift+P (or ⌘+⇧+P on macOS)
  3. Type and select Extensions: Install from VSIX...
  4. Browse and select the downloaded .vsix file
The editor installs the extension. Restart the editor to apply changes if prompted.
To install the extension using CLI, specify the editor executable and the --install-extension command-line switch, followed by the path to a .vsix file:
# Command for VSCode
code --install-extension <PATH_TO_EXTENSION.vsix>

# Command for VSCodium
codium --install-extension <PATH_TO_EXTENSION.vsix>

# Other VSCodium-based editors have similar commands
Visual Studio Code’s “Installing an extension from a VSIX” guide explains the process.

Features and language support

Extension provides support for TON Blockchain languages and tools in VSCode and VSCode-based editors: from syntax highlighting to on-the-fly inspections and toolchain management.

Tolk

File extension: .tolk Screenshot of the Tolk language supportScreenshot of the Tolk language support Tolk support includes:
  • Semantic syntax highlighting
  • Code completion with auto import, postfix completion, snippets, imports completion
  • Go to definition, type definition
  • Find all references, workspace symbol search, symbol renaming
  • Automatic import updates when renaming and moving files
  • Types and documentation on hover
  • Various inlay hints, including hints for types and parameter names.
  • On-the-fly inspections with quick fixes
  • Signature help inside calls
  • Build, test, and debug Blueprint-based projects
  • Flexible toolchain management

FunC

File extensions: .fc, .func Screenshot of the FunC language supportScreenshot of the FunC language support FunC support includes:
  • Semantic syntax highlighting
  • Code completion, imports completion
  • Go to definition
  • Find all references, workspace symbol search, symbol renaming
  • Automatic import updates when renaming and moving files
  • Types and documentation on hover
  • Inlay hints for method IDs
  • On-the-fly inspections
  • Build, test, and debug Blueprint-based projects

Fift

File extensions: .fif, .fift Screenshot of the Fift language supportScreenshot of the Fift language support Screenshot of the Fift assembly supportScreenshot of the Fift assembly support Fift support includes:
  • Basic and semantic syntax highlighting
  • Go-to definition
  • Inlay hints with instruction gas consumption
  • Hover documentation for instructions

TL-B

File extension: .tlb Screenshot of the TL-B data scheme supportScreenshot of the TL-B data scheme support TL-B support includes:
  • Basic and semantic syntax highlighting
  • Go-to definition
  • Completion for fields, parameters, and types
  • Go-to references for types
  • Hover documentation for declarations

TASM

File extensions:
  • .tasm — textual bitcode assembly
  • .boc — serialized binary smart contract code
Screenshot of the TON Assembly (TASM) language supportScreenshot of the TON Assembly (TASM) language support TON Assembly (TASM) support includes:
  • Basic syntax highlighting
  • Go-to definition
  • Inlay hints with instruction gas consumption
  • Hover documentation for instructions
  • Code completion for instructions
Additionally, BoC support includes:
  • Automatic BoC disassembly with syntax highlighting
  • Automatic updates on changes in BoC

Integrations

The extension integrates with:
  • Sandbox — Local TON emulator used to test smart contracts
  • Blueprint — a popular development environment for TON smart contract development

Sandbox

There is a graphical interface for local TON Blockchain emulation testing. By using it in Blueprint-based projects or any projects that use Sandbox (@ton/sandbox) for contract emulation, one can:
  • Deploy contracts directly from source code
  • Send internal and external messages
  • Execute get-methods
  • Inspect all transactions and messages
  • Inspect storage and balances in real time
  • Rollback to previous states and export or import various scenarios
It is suited for prototyping, interactive debugging, and educational purposes. To start, open the “TON Sandbox” panel in the primary sidebar after installing the extension, then follow instructions on top. The Sandbox wiki page provides more detail.

Usage

Configuration options

This extension provides a wide range of options configurable in the settings editor.

General

ton.tolk.stdlib.path
string
default:"auto"
Path to Tolk standard library. If empty, will try to find in node_modules.

Toolchain

ton.tolk.toolchain.toolchains
object
Configured Tolk toolchains. Each key serves as a unique identifier for the toolchain, which is an object with the following properties:
  • "name" (required) — Display name for the toolchain
  • "path" (required) — Path to the Tolk compiler executable
  • "description" — Optional description for the toolchain
Default configuration:
"ton.tolk.toolchain.toolchains": {
  "auto": {
    "name": "Auto-detected",
    "path": "",
    "description": "Automatically detect Tolk compiler in node_modules"
  }
}
ton.tolk.toolchain.activeToolchain
string
default:"auto"
Name of the active Tolk toolchain to use. The "auto" is a default toolchain that is automatically detected in node_modules/.
ton.tolk.toolchain.showShortCommitInStatusBar
boolean
default:false
Whether to add a short commit hash after Tolk version in the status bar.

Editor → Hints

ton.tolk.hints.disable
boolean
default:false
Tolk: Disable all inlay hints.
ton.tolk.hints.types
boolean
default:true
Tolk: Show type hints for variables and expressions.
ton.tolk.hints.parameters
boolean
default:true
Tolk: Show parameter name hints in function calls.
ton.tolk.hints.showMethodId
boolean
default:true
Tolk: Show method ID hints for get methods.
ton.tolk.hints.constantValues
boolean
default:true
Tolk: Show computed values for constants.
ton.func.hints.disable
boolean
default:false
FunC: Disable all inlay hints.
ton.func.hints.showMethodId
boolean
default:true
FunC: Show method ID hints for functions with method_id.
ton.func.hints.implicitConstantType
boolean
default:true
FunC: Show type hints for constants without explicit type.

Editor → Completion

ton.tolk.completion.typeAware
boolean
default:true
Tolk: Sort completion items by relevance to the current context type.
ton.tolk.completion.addImports
boolean
default:true
Tolk: Automatically add necessary imports for symbols from other files.

Editor → Inspections

ton.tolk.inspections.disabled
string[]
Tolk: List of disabled code inspections. All available inspections are enabled by default:
  • "unused-parameter"
  • "unused-type-parameter"
  • "unused-variable"
  • "unused-top-level-declaration"
  • "unused-import"
  • "deprecated-symbol-usage"
  • "struct-initialization"
  • "cannot-reassign"
  • "need-not-null-unwrapping"
  • "missed-semicolon"
  • "call-arguments-count-mismatch"
ton.func.inspections.disabled
string[]
FunC: List of disabled code inspections. All available inspections are enabled by default:
  • "unused-parameter"
  • "unused-type-parameter"
  • "unused-variable"
  • "unused-import"

Editor → Find Usages

ton.tolk.findUsages.scope
string
default:"workspace"
Tolk: Where to search when using “Find Usages”. Allowed values:
  • "workspace" (default) — Search only in workspace files
  • "everywhere" — Search everywhere, including the standard library

Fift

ton.fift.hints.showGasConsumption
boolean
default:true
Show gas consumption hints for Fift instructions.
ton.fift.semanticHighlighting.enabled
boolean
default:true
Enable/disable semantic highlighting for Fift files.

BoC

ton.boc.openDecompiledOnOpen
boolean
default:true
Automatically open decompiled Fift assembly when opening BoC files (with .boc extension).

Formatter

ton.tolk.formatter.useFormatter
boolean
default:true
Use experimental Tolk formatter.
ton.tolk.formatter.sortImports
boolean
default:true
Sort imports on format.

Sandbox

ton.sandbox.port
number
default:3000
Port of the TON Sandbox server.
ton.sandbox.binaryPath
string
default:"./node_modules/.bin/ton-sandbox-server"
Path to the TON Sandbox server binary.

Command Palette

The Ctrl+Shift+P on Windows and Linux (and ⌘+⇧+P on macOS) brings up the Command Palette. This plugin provides a number of custom commands available for launch from the palette.

General

  • TON: Open decompiled BoC file
  • TON: Decompile BoC to TON Assembly file
  • TON: Debug contract

Tolk

  • Tolk: Build project
  • Tolk: Get type at position
  • Tolk: Get contract ABI
  • Tolk: Get documentation at position
  • Tolk: Get scope information
  • Tolk: Get unresolved identifiers
  • Tolk: Show toolchain information
  • Tolk: Select active toolchain — modifies the config
  • Tolk: Add new toolchain — modifies the config
  • Tolk: Remove toolchain — modifies the config
  • Tolk: Manage toolchains — modifies the config

Sandbox

Work everywhere:
  • TON: Install TON Sandbox Server — modifies the config
  • TON: Start TON Sandbox Server
  • TON: Stop TON Sandbox Server
  • TON: Open Sandbox Terminal
Only work in the Sandbox panel:
  • TON: Refresh
  • TON: Refresh history
  • TON: Import history
  • TON: Export history
  • TON: Reset history
  • TON: Delete message template
  • TON: Copy contract ABI
  • TON: Copy address