ton-blockchain / intellij-ton Goto Github PK
View Code? Open in Web Editor NEWTON Development plugin for the IntelliJ Platform
Home Page: https://plugins.jetbrains.com/plugin/23382-ton
License: GNU General Public License v3.0
TON Development plugin for the IntelliJ Platform
Home Page: https://plugins.jetbrains.com/plugin/23382-ton
License: GNU General Public License v3.0
Plugin currently doesn't support multiline asm functions using triple quotes (""""). Example:
slice hello_world() asm """
"Hello"
" "
"World"
$+ $+ $>s
PUSHSLICE
""";
Problem:
Every time you have to copy the used schemes from block.tlb
Suggested solution:
Add block.tlb as background import, like stdlib.fc.
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();
}
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
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.
Syntax highlight fails on numeric type names
test$_ a:bits900 = 900Bits;
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.
Need add support native repeat command, so that it works like with a FOR in Java.
c#5FE a:(## 32) = AMultiTagInt;
d#3F5476CA a:(## 32) = AMultiTagInt;
This is valid syntax, but highlight will crash
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.
Multiline asms added in version 0.3.0
The extension does not support this and interprets it as an error, because of this the rest of the code formatting breaks
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.
While using multiple conditions, the lexer does not notice the error.
Broken code: (cpu > max_cpu | cpu < min_cpu)
Working code: ((cpu > max_cpu) | (cpu < min_cpu))
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
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.
Функция 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 ();
}
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
Currently plugin doesn't support ternary expressions.
Reference in TON docs: https://ton.org/docs/#/func/statements?id=conditional-operator
Plugin version: 0.7.0
I propose to create a Github Project Board for a more convenient and transparent process of developing a plugin and prioritizing tasks.
I propose to add live templates to the most frequently used pieces of code.
Ex:
if (flags & 1) { throw(error::bounce()); return (); }
() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {
}
() recv_external(slice in_msg_body) impure {
}
_ my_get_method() method_id {
}
and etc.
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
I propose to add an IntelIJ trick that allows you to convert strings such as
const int i = 1;
to such (int) i() asm "PUSHINT 1"
and vice versa.
This will help to refactor the code more conveniently and make it more gas-efficient.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.