Git Product home page Git Product logo

pizza-777 / everscale-solidity-vscode-extension Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 4.09 MB

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

License: Apache License 2.0

JavaScript 63.88% Solidity 36.12%
autocomplete everscale-blockchain solidity syntax-highlighting venom-blockchain venom-developer-program vscode-extension blockchain ton venom-smart-contracts

everscale-solidity-vscode-extension's Introduction

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

everscale-solidity-vscode-extension's People

Contributors

dependabot[bot] avatar pizza-777 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

everscale-solidity-vscode-extension's Issues

Fix comments formatting

formatting it this case doesn't work

pragma ton-solidity >=0.61.2;
contract Comments13 {
	modifier modifier1() {
		_;
	}
    modifier            modifier2() {
		_;
	}	modifier modifier3(uint a) {
		_;
	}
  function commentInModifierInvocation() 
      external 
      // comment 1
                           modifier1 // comment 2
      (
        // comment 3
      ) // comment 4
      // comment 5
      modifier2 // comment 6
      (
        /* comment 7 */
      ) // comment 8
      modifier3 // comment 9
      (
        // comment 10
       1 // comment 11
        // comment 12
      ) // comment 13
      {
  }
}

Support ever-solidity pragma

Running extension build 1.4.39 with [email protected] and ton solidity compiler version 0.62.0

this sniptes returns error Error: Error: Source file requires different compiler version (current compiler is 0.62.0+commit.e66e9ac9.Darwin.appleclang)

pragma ever-solidity >= 0.61.2;
pragma AbiHeader expire;
pragma AbiHeader pubkey;
// this is enabled by default
pragma AbiHeader time;

import '@broxus/tip4/contracts/TIP4_1/TIP4_1Nft.tsol';


contract Nft is TIP4_1Nft {

    constructor(
        address owner,
        address sendGasTo,
        uint128 remainOnNft
    ) TIP4_1Nft(
        owner,
        sendGasTo,
        remainOnNft
    ) public {}
}

I guess we need to support ever-solidity right as well as ton-solidity right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.