# TON extension for Visual Studio Code (VS Code) and VSCode-based editors (https://docs-kyrm16yq7-ton-core-docs.vercel.app/llms/contract-dev/ide/vscode/content.md)



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

<Columns cols="3">
  <Card title="Installation" icon="floppy-disk" horizontal="true" href="#installation" />

  <Card title="Features" icon="sparkles" horizontal="true" href="#features-and-language-support" />

  <Card title="Usage" icon="hammer" horizontal="true" href="#usage" />
</Columns>

## Installation [#installation]

### From Visual Studio Marketplace [#from-visual-studio-marketplace]

Applicable for: VSCode <br />
Extension on: [Marketplace](https://marketplace.visualstudio.com/items?itemName=ton-core.vscode-ton "TON extension on the Visual Studio Marketplace")

1. In the editor, open the Command Palette with <kbd>Ctrl+Shift+P</kbd> (or <kbd>⌘+⇧+P</kbd> on macOS)
2. Type and select `Extensions: Install Extensions`
3. Search for `TON`
4. Select the official extension from TON Core and click <kbd>Install</kbd>

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 <kbd>Install</kbd> button:

<Image src="/images/vscode-ton/install.png" darkSrc="/images/vscode-ton/install-dark.png" alt="Screenshot of extension installation" />

### From Open VSX Registry [#from-open-vsx-registry]

Applicable for: VSCodium, Cursor, Windsurf, and other VSCodium-based editors <br />
Extension in: [Registry](https://open-vsx.org/extension/ton-core/vscode-ton "TON extension in the Open VSX Registry")

Installation steps are identical to the [VSCode setup](#from-visual-studio-marketplace). Additionally, one can download the exact extension version from the [Open VSX Registry](https://open-vsx.org/extension/ton-core/vscode-ton) and then proceed with [installation from disk](#from-disk).

### From disk [#from-disk]

Applicable for: any VSCodium-based editor <br />
VSIX file: [latest GitHub release](https://github.com/ton-blockchain/ton-language-server/releases/latest)

To manually install the extension:

1. Download the `.vsix`-packaged plugin archive from the [latest GitHub release](https://github.com/ton-blockchain/ton-language-server/releases/latest) or from the exact version [in the registry](https://open-vsx.org/extension/ton-core/vscode-ton)
2. In the editor, open the Command Palette with <kbd>Ctrl+Shift+P</kbd> (or <kbd>⌘+⇧+P</kbd> 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.

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

  ```shell
  # 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
  ```
</Callout>

Visual Studio Code’s [“Installing an extension from a VSIX”](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_install-from-a-vsix) guide explains the process.

## Features and language support [#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.

<Columns cols="2">
  <Card title="Tolk" icon="star" horizontal="true" href="#tolk">
    Recommended language for TON smart contract development
  </Card>

  <Card title="FunC" icon="building-columns" horizontal="true" href="#func">
    Legacy TON smart contract programming language
  </Card>

  <Card title="Fift" icon="layer-group" horizontal="true" href="#fift">
    Low-level stack-based language with deep TVM integration
  </Card>

  <Card title="TL-B" icon="table-cells" horizontal="true" href="#tl-b">
    Cell-based data serialization and markup language
  </Card>

  <Card title="TON Assembly (TASM)" icon="binary" horizontal="true" href="#tasm">
    Textual TVM bitcode assembly language and corresponding (dis)assembler
  </Card>

  <Card title="Integrations" icon="toolbox" horizontal="true" href="#integrations">
    Work with Acton projects and other tools for TON development
  </Card>
</Columns>

### Tolk [#tolk]

**File extension:** `.tolk`

<Image src="/images/vscode-ton/tolk.png" darkSrc="/images/vscode-ton/tolk-dark.png" alt="Screenshot 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 [Acton](/llms/contract-dev/acton/content.md)-based projects
* Flexible toolchain management

### FunC [#func]

**File extensions:** `.fc`, `.func`

<Image src="/images/vscode-ton/func.png" darkSrc="/images/vscode-ton/func-dark.png" alt="Screenshot 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 [Acton](/llms/contract-dev/acton/content.md)-based projects

### Fift [#fift]

**File extensions:** `.fif`, `.fift`

<Image src="/images/vscode-ton/fift.png" darkSrc="/images/vscode-ton/fift-dark.png" alt="Screenshot of the Fift language support" />

<Image src="/images/vscode-ton/fift-asm.png" darkSrc="/images/vscode-ton/fift-asm-dark.png" alt="Screenshot 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 [#tl-b]

**File extension:** `.tlb`

<Image src="/images/vscode-ton/tlb.png" darkSrc="/images/vscode-ton/tlb-dark.png" alt="Screenshot 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 [#tasm]

**File extensions:**

* `.tasm` — textual bitcode assembly
* `.boc` — serialized binary smart contract code

<Image src="/images/vscode-ton/tasm.png" darkSrc="/images/vscode-ton/tasm-dark.png" alt="Screenshot 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 [#integrations]

The extension integrates with [Acton](/llms/contract-dev/acton/content.md) — a recommended modern all-in-one Tolk smart contract development environment.

<Callout type="note" title="Older integrations">
  [Plugin versions `v0.6.0` and below](https://marketplace.visualstudio.com/items?itemName=ton-core.vscode-ton) also offer support for:

  * [Blueprint](/llms/contract-dev/blueprint/overview/content.md) — comprehensive TypeScript development environment for TON smart contract development
  * [Sandbox](#sandbox) — Local TON emulator used to [test](/llms/contract-dev/testing/overview/content.md) smart contracts

  Since version `v1.0.0`, Acton is used as the primary TON development toolchain.
</Callout>

#### Sandbox [#sandbox]

<Badge color="red">
  Available only in versions 

  `v0.6.0`

   and below
</Badge>

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](https://github.com/ton-blockchain/ton-language-server/wiki/Sandbox:-1.-Overview) provides more detail.

## Usage [#usage]

* Customize the default config by [setting various options](#configuration-options)
* Utilize commands from the [Command Palette](#command-palette)

### Configuration options [#configuration-options]

This extension provides a wide range of options configurable in the [settings editor](https://code.visualstudio.com/docs/getstarted/extensions#_open-extension-settings).

#### General [#general]

<ParamField path="ton.tolk.stdlib.path" type="string" default="auto">
  Path to Tolk standard library. If empty, will try to find in `node_modules`.
</ParamField>

#### Toolchain [#toolchain]

<ParamField path="ton.tolk.toolchain.toolchains" type="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:

  ```json
  "ton.tolk.toolchain.toolchains": {
    "auto": {
      "name": "Auto-detected",
      "path": "",
      "description": "Automatically detect Tolk compiler in node_modules"
    }
  }
  ```
</ParamField>

<ParamField path="ton.tolk.toolchain.activeToolchain" type="string" default="auto">
  Name of the active Tolk toolchain to use. The `"auto"` is a default toolchain that is automatically detected in `node_modules/`.
</ParamField>

<ParamField path="ton.tolk.toolchain.showShortCommitInStatusBar" type="boolean" default="false">
  Whether to add a short commit hash after Tolk version in the status bar.
</ParamField>

#### Editor → Hints [#editor--hints]

<ParamField path="ton.tolk.hints.disable" type="boolean" default="false">
  Tolk: Disable all inlay hints.
</ParamField>

<ParamField path="ton.tolk.hints.types" type="boolean" default="true">
  Tolk: Show type hints for variables and expressions.
</ParamField>

<ParamField path="ton.tolk.hints.parameters" type="boolean" default="true">
  Tolk: Show parameter name hints in function calls.
</ParamField>

<ParamField path="ton.tolk.hints.showMethodId" type="boolean" default="true">
  Tolk: Show method ID hints for get methods.
</ParamField>

<ParamField path="ton.tolk.hints.constantValues" type="boolean" default="true">
  Tolk: Show computed values for constants.
</ParamField>

<ParamField path="ton.func.hints.disable" type="boolean" default="false">
  FunC: Disable all inlay hints.
</ParamField>

<ParamField path="ton.func.hints.showMethodId" type="boolean" default="true">
  FunC: Show method ID hints for functions with `method_id`.
</ParamField>

<ParamField path="ton.func.hints.implicitConstantType" type="boolean" default="true">
  FunC: Show type hints for constants without explicit type.
</ParamField>

#### Editor → Completion [#editor--completion]

<ParamField path="ton.tolk.completion.typeAware" type="boolean" default="true">
  Tolk: Sort completion items by relevance to the current context type.
</ParamField>

<ParamField path="ton.tolk.completion.addImports" type="boolean" default="true">
  Tolk: Automatically add necessary imports for symbols from other files.
</ParamField>

#### Editor → Inspections [#editor--inspections]

<ParamField path="ton.tolk.inspections.disabled" type="string[]" default="[]">
  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"`
</ParamField>

<ParamField path="ton.func.inspections.disabled" type="string[]" default="[]">
  FunC: List of disabled code inspections. All available inspections are enabled by default:

  * `"unused-parameter"`
  * `"unused-type-parameter"`
  * `"unused-variable"`
  * `"unused-import"`
</ParamField>

#### Editor → Find Usages [#editor--find-usages]

<ParamField path="ton.tolk.findUsages.scope" type="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
</ParamField>

#### Fift [#fift-1]

<ParamField path="ton.fift.hints.showGasConsumption" type="boolean" default="true">
  Show gas consumption hints for Fift instructions.
</ParamField>

<ParamField path="ton.fift.semanticHighlighting.enabled" type="boolean" default="true">
  Enable/disable semantic highlighting for Fift files.
</ParamField>

#### BoC [#boc]

<ParamField path="ton.boc.openDecompiledOnOpen" type="boolean" default="true">
  Automatically open decompiled Fift assembly when opening BoC files (with `.boc` extension).
</ParamField>

#### Formatter [#formatter]

<ParamField path="ton.tolk.formatter.useFormatter" type="boolean" default="true">
  Use experimental Tolk formatter.
</ParamField>

<ParamField path="ton.tolk.formatter.sortImports" type="boolean" default="true">
  Sort imports on format.
</ParamField>

#### Sandbox [#sandbox-1]

<Badge color="red">
  Available only in versions 

  `v0.6.0`

   and below
</Badge>

<ParamField path="ton.sandbox.port" type="number" default="3000">
  Port of the TON Sandbox server.
</ParamField>

<ParamField path="ton.sandbox.binaryPath" type="string" default="./node_modules/.bin/ton-sandbox-server">
  Path to the TON Sandbox server binary.
</ParamField>

### Command Palette [#command-palette]

The <kbd>Ctrl+Shift+P</kbd> on Windows and Linux (and <kbd>⌘+⇧+P</kbd> on macOS) brings up the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette). This plugin provides a number of custom commands available for launch from the palette.

#### General [#general-1]

* `TON: Open decompiled BoC file`
* `TON: Decompile BoC to TON Assembly file`
* `TON: Debug contract`

#### Tolk [#tolk-1]

* `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 [#sandbox-2]

<Badge color="red">
  Available only in versions 

  `v0.6.0`

   and below
</Badge>

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`
