Skip to content

VSCode extension for Solidity language for developing smart contracts on TVM-compatible blockchains.

License

Notifications You must be signed in to change notification settings

pizza-777/everscale-solidity-vscode-extension

Repository files navigation

Everscale Solidity support for Visual Studio Code

Everscale (TON) Solidity is the language used in Everscale blockchain to create smart contracts. This extension provides:

  • Syntax highlighting
  • Snippets with details
  • Checking for errors, warnings and highlighting it
  • Display an information popup on hover
  • Suggesting function params when typing
  • Search of definition
  • Code formatter
  • DeBots interfaces highlighting, autocompletion, support for imports

Installation

Extension Marketplace

Extension can be installed from the Visual Studio Code Marketplace.

Also You can launch Quick Open, paste the following command, and press Enter

ext install everscale.solidity-support

CLI

With shell commands installed, you can use the following command to install the extension:

$ code --install-extension everscale.solidity-support

Build from source

git clone https://github.com/pizza-777/everscale-solidity-vscode-extension.git
npm install
npm install -g vsce
vsce package

Then go to Extensions tab and click on the three dots on the top and select "Install from VSIX". Choose generated the .vsix file.

Screenshot 2023-03-01 22:54:37

Configuration

You can add the following to your settings.json:

{
  "files.associations": {
    "*.sol": "ton-solidity",
    "*.tsol": "ton-solidity"
  }
}
{
  "[ton-solidity]": {
    "editor.defaultFormatter": "everscale.solidity-support",

    "files.trimTrailingWhitespace": false,
    "files.trimFinalNewlines": false,

    "editor.formatOnSave": false,
    "editor.formatOnPaste": false,
    "editor.formatOnType": false    
  }
}

To configure code formatting you can use standart prettier.io rules.

For example:

{
  "overrides": [
    {
     "files": ["*.sol","*.tsol"],
      "options": {
        "printWidth": 60,
        "tabWidth": 2,
        "useTabs": false,
        "singleQuote": false,
        "bracketSpacing": false,
        "explicitTypes": "always"
      }
    }
  ]
}

Features

Highlighting

For example, light and dark themes: "Solarized Light" and "Material Theme": solarized-light material-theme

Ton-solidity autocomplete with detailed information

Use Ctrl+Space

autocomplete-with-detailed-information

Contract's functions autocompletion

contract-functions-autocomplete

Code diagnostic on the fly

code-diagnostic

On hover information

hover-information

Params helper

params-helper

This extension only working with TON Solidity language. If You are using Ethereum Solidity, use other extensions for this. You have quick switch between two solidity languages:

language-switcher

Search of definition

go-to-definition

Code formatter

formatter

How to contribute

If You found a typo or want to improve something, a pull request is welcome. Some files meaning and locations:

./src/snippets/completion.json — almost all completions snippets

./src/snippets/hover.json — all hover popups

./src/syntaxes/ton-solidity.json — syntax highlighting rules

Contacts

Telegram: @pizzza777