Giter Club home page Giter Club logo

intellij-ton's People

Contributors

andreypfau avatar dependabot[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

intellij-ton's Issues

Problems with function call color

I went in Preferences -> Editor -> Color Scheme -> FunC and tried change Function call foreground color to FFC66D. But the color has changed not only for function calls, but also for their arguments. This looks like a bug.

изображение

Add refactor rename function

Suppose I have #include "helpers/constants.func"; in my code. I want to rename folder helpers to utils. So, I suggest that plugin automatically fix #include like in other languages, when I use refactor/rename feature.

Add block.tlb as background import

Problem:
Every time you have to copy the used schemes from block.tlb
Suggested solution:
Add block.tlb as background import, like stdlib.fc.

Github Project

I propose to create a Github Project Board for a more convenient and transparent process of developing a plugin and prioritizing tasks.

`elseif` & `elseifnot` statements

Add support for elseif & elseifnot statements.

However, due to a bug in the func compiler, this needs to be added as part of the `if' statement, since such declarations do not work correctly:

if (flag1) {
    do_something1();
} elseif (flag2) {
    do_alternative2();
} elseif (flag3) {
    do_alternative3();
}

that is, the final declaration should look like this:

if (flag1) {
    do_something1();
} elseif (flag2) {
    do_alternative2();
} elseifnot (flag3) {
    do_alternative3();
} else {
    do_alternative4();
}

Additional goals for research

To figure out why the sequential elseif { } elseif { } statement does not work correctly and write an issue to the main ton-blockchain repository and make appropriate changes to the above repository

(2.0) Type system

At the moment, most of the useful checks are not available, due to the fact that the plugin knows nothing at all about typing in the FunC.
The development of a type system will eliminate the need for the most important checks.

Support different level function references

Plugin does not support peeking to a definition of a different nesting level functions other than a level of a current file. Finding functions on the same level works fine.

Would be great to implement this feature.

Plugin version: 0.8.0

ton-idea-peeking.mov

Warn about dangerous FunC compiler code removal

FunC compiler may remove "impure" code.

Practically:
a) "impure" modifier present - guarantees correct behaviour
b) "impure" modifier absent - FunC compiler will do strange things, such as strip out some code without your permission.

It will silently remove the function call in two cases:

a) function returns nothing:

() fun() { set_data(begin_cell().end_cell()); }

b) function returns something, but this something is not assigned to anything:

(int) fun() { set_data(begin_cell().end_cell()); return 5; } 
...
int a = fun(); ;; fun is called
fun(); ;; fun call is removed

This is a very bad behavior of FunC compiler, which should be altered. It is ideal to change FunC compiler itself, but that is how it is for now, and it will be good to warn plugin users by highlighting code, which is going to be stripped by the compiler.

(2.0) Live templates

I propose to add live templates to the most frequently used pieces of code.

idea64_UDKJemcF5k

Ex:

  1. Bounce check bche
    if (flags & 1) { throw(error::bounce()); return (); }
  2. recvi
() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {
    
}

  1. recve
() recv_external(slice in_msg_body) impure {
    
}

  1. gete
_ my_get_method() method_id {

}

and etc.

(2.0) Automatic convertation if to throw_if

I propose to automatically convert such structure languages if (i > b) { throw(error); } to such throw_if(error, i > b); due to the fact that due to the formed habit of programming in other programming languages, the language structure throw_if is not so familiar, but more syntactically correct.

TLB uppercase HEX

c#5FE a:(## 32) = AMultiTagInt;
d#3F5476CA a:(## 32) = AMultiTagInt;

This is valid syntax, but highlight will crash

Parse bug

Функция test возвращает (int, int, int, cell), в main я принимаю от нее только (int, int, cell), расширение не подсвечивает ошибки.

forall X -> X null() asm "PUSHNULL";

(int, int, int, cell) test () inline {
    return (0, 0, 0, null());
}

() main () {
    (int a, int b, cell c) = test();
    return ();
}

(2.0) Function generation

I suggest adding function body generation when writing it, as is done for example in Java.
idea64_HDckgn8A9A

This will help you write code much faster and more optimally, without being distracted by routine.

(2.0) Repeat support

Need add support native repeat command, so that it works like with a FOR in Java.

2023-08-17.02.15.53.mov

Code suggestions don't show after . (dot)

Create slice "cs", for example:

cell actions;
slice cs = actions.begin_parse();

Type cs.

Expected behavior: suggestions show up
Current behavior: nothing happens

Press Ctrl+Space

Expected behavior: suggestions show up
Current behavior: nothing happens

(2.0) Return compliance check

I propose to add a check for compliance of the returned value with the signature.
Also add a proposal to change the signature, and correct the lines that call this function.

idea64_4bZiGMq3cs

(2.0) Include assist

I suggest adding help writing #include suggesting possibly relevant files for the user.
I also suggest adding a highlight if the include is not used and suggestions for using functions from neighboring .fc files, with the automatic addition of the #include line.

idea64_ZhWPMUekpk

idea64_NVtrOStu6G

(2.0) Lexer and operators

The statement lexer needs to be corrected because it does not notice an error in such a line (int sum+= a + b;) when it causes a compilation error. Thus, having a large code, it is easy to miss it.

(2.0) If generation

I propose to change the code generation logic when writing "if" and make it similar to Java, due to the fact that at the moment automatic closing of conditions only creates additional problems.
idea64_9YS3kLI8Ix

(2.0) Perpetual Loop Warning

For now, writing an infinite loop will not throw any error.
I propose to add a separate check that will emphasize this not as an error, but as code that may already cause an error at runtime.
2023-08-16 23 55 03

Autocomplete global variables

Adding auto-completion for global variables in smart-contract files. Now it can autocomplete, but only in the file where the variable was defined and without understanding that it is a variable.
image

Irrelevant code suggestions after . (dot)

Create slice "cs", for example:

cell actions;
slice cs = actions.begin_parse();

Type cs.l (small L) then Ctrl+Space, suggestions show up, but

Current behavior: they include irrelevant suggestions = such that the first parameter of the function is not "slice"
Expected behavior: only relevant suggestions (with first parameter of type "slice") show up

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.