Coder Social home page Coder Social logo

broxus / intellij-t-sol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intellij-solidity/intellij-solidity

12.0 2.0 2.0 4.98 MB

Everscale-Solidity plugin for IntelliJ

Home Page: https://plugins.jetbrains.com/plugin/20696-t-sol

License: MIT License

Shell 0.10% Java 0.07% Kotlin 96.07% HTML 0.30% Lex 3.47%
everscale idea-plugin intellij-plugin smart-contract-tools solidity tools blockchain venom-blockchain venom-developer-program

intellij-t-sol's Introduction

T-Sol (Threaded Solidity) plugin for JetBrains IDEs

Latest version JetBrains plugins JetBrains rating License

Logo

Logo

T-Sol (short for Threaded Solidity) JetBrains IDEs plugin is designed to make writing TVM-based smart contracts more comfortable and faster. It is based on Sergey Tselovalnikov's original Solidity plugin (kudos!) and features syntax prompts and autofilling while writing code. The plugin is also open-source and was released under the MIT license.

T-Sol proposes Threaded Solidity, the new name for TVM-based Solidity and works with files with the .tsol extension, making it easier to navigate between EVM and TVM smart contract files, which previously had the same .sol extension.

Features

  • Syntax highlighting
  • Code completion
  • File templates
  • Goto declaration
  • Find usages
  • Code formatting

Supporting the plugin

You can support the development by clicking ★ on GitHub and rating it on the plugin page.

Reporting an issue

Please attach the screenshot for every issue if possible. It will make the issue much clearer and easier to understand.

Build

./gradlew buildPlugin

Run

./gradlew runIdea

Contribute

Contributions are always welcome!

intellij-t-sol's People

Contributors

0v1se avatar 30mb1 avatar apottere avatar carter-ya avatar cedricwalter avatar dukei avatar dyzz avatar evgenynacu avatar fooock avatar gitter-badger avatar ice1000 avatar idrabenia avatar logvinovleon avatar mbolotov avatar mikebolotov avatar moodysalem avatar patitonar avatar pironmind avatar serceman avatar ualtinok avatar vlad-khramov avatar vp-mazekine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

intellij-t-sol's Issues

not support assembly

// SPDX-License-Identifier: UNLICENSED
pragma ever-solidity >= 0.71.0;

function _add(uint a, uint b) assembly pure returns (uint) {
  "ADD",
}

contract App {
  function add(uint a, uint b) external pure returns (uint) {
    return _add(a, b);
  }
}

image

';', , , Identifier, externalMsg, functionID, inline, internalMsg, returns or '{' expected, got 'assembly'

Allow using integers with arbitrary bit size

Solidity ABI allows the use of integers with arbitrary bit width (up to 256 bits). However, the plugin doesn't seem to be able to recognize such integers as a built-in type. It would be nice to have all built-in types covered completely.

image

Problems with function input types resolving

import {DateTime as DateTimeLib} from "../../libraries/DateTime.tsol";

struct DateTime {
    uint16 year;
    uint8 month;
    uint8 day;
    uint8 hour;
    uint8 minute;
}

struct DateTimeInterval {
    DateTime from;
    DateTime to;
}

Contract A {
    function _dateTimeToTimestamp(DateTime dt) internal pure returns (uint32) {
        return uint32(DateTimeLib.timestampFromDateTime(dt.year, dt.month, dt.day, dt.hour, dt.minute, 0));
    }

   function _addMarketWeekends(DateTimeInterval _new_weekend) internal {
        uint32 _new_weekend_start = _dateTimeToTimestamp(_new_weekend.from);
        uint32 _new_weekend_end = _dateTimeToTimestamp(_new_weekend.to);
   }

I get Argument of type 'DateTime' is not assignable to parameter of type 'DateTime' when calling _dateTimeToTimestamp from _addMarketWeekends

Gray out unused items

Existing behavior

Any code piece, independent of whether it is being used or not, is displayed as active and used.

Expected behavior

Gray out unused imports, variables, structures, constants, functions, abstract contracts, interfaces, etc.

address.makeAddrStd() with inline args

address = address.makeAddrStd(0, 0);

Results in Argument of type 'uint8' is not assignable to parameter of type 'int8'
Which is ok for compiler, because 0 is constructed as int8 here (type is inherited from usage)

Use inline code refactoring instead of popups

Current behavior

  • User presses Shift+F6 on the desired word
  • Popup appears showing refactoring options
    image
  • User inputs new name and clicks OK to finalize the refactoring

Expected behavior

  • User presses Shift+F6 on the desired word
  • IDE enters the dynamic refactoring mode and highlights the word and all its mentions in the code
  • User changes the word and presses ENTER to finalize
    image
  • OR user presses ESC to cancel editing

We need to support refactoring fetures of IDE

  1. When the file name going to rename we need to suggest changing the contract name
    image
  2. When the file was renamed or moved we need to update imports inside files that depend on this file

'.', ';', <storage location> or global expected, got '('

'.', ';', <storage location> or global expected, got '('
<constant variable declaration>, <contract definition>, <expression>, <function definition>, <function invocation>, enum, error, import, pragma, struct, type or using expected, got ';'

image

Natspec comments starting from `/**` break syntax highlighting

Summary

When inputting comments in a block NatSpec (i.e., starting from /**), syntax highlighting breaks for all functions that lay below it.
image

Steps to reproduce

  • Create a function declaration
  • Create NatSpec block /**...*/
  • Syntax highlighting breaks

Note

The bug is unstable: in certain conditions, it doesn't cause a breaking effect. Typically, the functions added to the end of the contract are affected instead of the ones in the middle.

`Structure` pane displays the wrong content when another item is single-clicked in file tree

How to reproduce

  1. Open a file (ArrayHelper.tsol in this example) for editing in IDE
  2. Select the Structure pane to see elements in it
    image
  3. Now, switch back to Project pane and single-click on any other file in the file tree (e.g., locklift.config.ts)
    image
  4. Go back to Structure pane to see that it now displays the contents of the locklift.config.ts file instead of ArrayHelper.tsol
    image
  5. Click in the editing area to see that Structure pane went back to normal

Expected behavior

Structure pane always displays the contents of the currently edited file

Opening a file with absolute path in IDE

telegram-cloud-photo-size-2-5402309362577426833-y
If i'm compiled contracts i'm give error:
.......Unknown exception during compilation: boost::filesystem::canonical: No such file or directory [generic:2]: "/abstract/OrderBase.tsol
Because abstract/OrderBase.tsol it error, must be:./abstract/OrderBase.tsol

Formatter issues

  1. JSON
    Before running the format
    image

After running the format

image

The formatted result should look like this :

image

  1. After running format imports should be sorted
    image

When using vector(<Some Type>) plugin loses type information.

When I use a variable of struct type, I have information about its methods like unpack();

struct Limits {uint l; uint r;}
Limits l = Limits(0, res.length - 1);
l.unpack();

If I acquire the same type from vector, plugin loses type info:

vector(Limits) s;
s.pop().unpack(); // shows error

Here's the full image:
image

Setting --libPath is problematic with this plugin

As you may know, solc has options for settting --lib-path. It's a good choice for adding common (or foreign) libs between projects. I didn't found how I can use it with t-sol plugin.
The problem is that --lib-path can't be in subdirectories of contract's tsol file. And if something is not part of tsol location subdirs (and path to import is not absolute) plugin will not see it.
It's perfectly ok, not a bug or wrong logic, but perhaps we can have a little setting in a plugin to set a custom additional path that will be indexed.

Autocompletion for `pragma AbiHeader`

There is a set of predefined and widely used headers (time, expire, pubkey). It would be nice to have an autocompletion and some kind of docs for them.

Add SPDX License suggestions

Existing behavior

T-Sol allows indication of the applicable SPDX code for the license used:
image

However, no auto-suggest for available licenses is available at the moment.

Expected behavior

  1. Upon entering the // SPDX-License-Identifier: automatically suggest the list of SPDX license codes with dynamic filtering upon typing
  2. Analyze the most frequently used license code throughout the codebase of the project and, if the license code of the current file differs, suggest either (a) updating it to the most frequently used or (b) applying the license code from this file to other files in the project
  3. If SPDX code is specified anywhere in the source code tree, recommend adding it to all missing files.

Support type arguments in built-in functions

Current behavior

The plugin cannot recognize the nested type of the optional parameter passed to the function and, consequently, does not see its members.

image
image

Expected behavior

Plugin correctly identifies the nested type and provides proper hints and suggestions.

Broken lookup for libraries renamed on import

import {DateTime as DateTimeLib} from "./libraries/DateTime.tsol";

...
DateTimeLib.doSomething();
...
  1. DateTimeLib will not be autocompleted in code
  2. doSometing() wont be advised by IDE

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.