Coder Social home page Coder Social logo

itemiscreate / solidity-ide Goto Github PK

View Code? Open in Web Editor NEW
87.0 87.0 25.0 226.17 MB

Solidity plugin for Eclipse

License: Eclipse Public License 1.0

Java 84.19% Xtend 10.86% CSS 0.12% HTML 2.41% JavaScript 0.05% Dockerfile 0.05% TypeScript 2.22% Shell 0.02% Less 0.02% Solidity 0.06%
eclipse ethereum ide language-server-protocol smartcontract solidity theia-extension vscode-extension xtext yakindu

solidity-ide's People

Contributors

andreasmuelder avatar beckmar avatar cdietrich avatar dependabot[bot] avatar flantony avatar jthoene avatar mazesch avatar nyssen avatar tkutz 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solidity-ide's Issues

SolidityGlobalScopeProvider: Remove dependency on ResourcesPlugin

All code in the runtime project must be independent from running within Eclipse. The SolidityGlobalScopeProvider depends on ResourcesPlugin to do some URI conversion. This has to be solved differently.

ReferenceExamplesTest fails for some input files with a NoClassDefFoundError for ResourcesPlugin.

[Quickfix] Could not serialize ElementReferenceExpression via backtracking.

Apply "Replace with assert" for "throw" in following example:

pragma solidity ^0.4.18 ; contract B { address a; function blabla( ) public { if (true) { throw; } } }

Get following Exception in org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.ExceptionThrowingAcceptor#accept(..)

Constraint: ElementReferenceExpression_ElementReferenceExpression returns ElementReferenceExpression: (
    reference=[EObject|ID] 
    ((operationCall?='(' (arguments+=Argument arguments+=Argument*)?) | (arrayAccess?='[' arraySelector+=Expression arraySelector+=Expression*))?
);
Values: arguments(1), reference(1), operationCall(0-1), arrayAccess(0-1)
Semantic Object: SolidityModel.sourceunit[0]->SourceUnit.member[0]->ContractDefinition'B'.features[1]->FunctionDefinition'blabla'.block->Block.statements[0]->ExpressionStatement.expression->ElementReferenceExpression
URI: platform:/resource/test/src/b.sol
Context: Expression returns ElementReferenceExpression```

Templates

  • Contract
  • Functions : kill, ... look at docu for common patterns
  • while, for, if

[BUG] functions shadow parameters

pragma solidity ^0.4.8;

contract Bug {

function abc() {
}

function abcd(int abc){
int x = abc; // this links to function instead of parameter
}
}

Provide New File wizard

There should be a dedicated New File wizard to create Solidity files. The new file should contain a pragma directive for the current Solidity version.

Make used EPackage & EFactory instances injectable

Sometimes it is nicer to inject the EPackage or EFactory to simplify the code. For example, in BuildInDeclarations.xtend there are many constructs like

TypesFactory.eINSTANCE.createOperation => [...]

When the factory is injected as extension this would read like:

@Inject extension TypesFactory

...
createOperation => [...]

Provide Oomph Setup

To facilitate collaboration on the project an Oomph setup should be provided.

Grammar ambiguity RULE_HEX,RULE_INT

The following warning is reported while translating the language:

error(208): ../com.yakindu.solidity/src-gen/com/yakindu/solidity/parser/antlr/internal/InternalSolidity.g:6785:1: The following token definitions can never be matched because prior tokens match the same input: RULE_HEX,RULE_INT
error(208): ../com.yakindu.solidity.ide/src-gen/com/yakindu/solidity/ide/contentassist/antlr/internal/InternalSolidity.g:16403:1: The following token definitions can never be matched because prior tokens match the same input: RULE_HEX,RULE_INT

Improve folding

The default code folding feature produces too many folding locations. See for example this screenshot:

screenshot 7

I think we should provide folding in a first nearing for:

  • comment blocks
  • contract def
  • function def

From that set on, we should add more folding if we find reasonable use cases (e.g. very long control statements) and add them by separate feature request.

[Validation] View Function

Add a validation that detects if a function can be marked as 'view' function, provide quickfix
From the docu:

Functions can be declared view in which case they promise not to modify the state.

The following statements are considered modifying the state:

Writing to state variables.
Emitting events..
Creating other contracts.
Using selfdestruct.
Sending Ether via calls.
Calling any function not marked view or pure.
Using low-level calls.
Using inline assembly that contains certain opcodes.
pragma solidity ^0.4.16;

contract C {
function f(uint a, uint b) view returns (uint) {
return a * (b + 42) + now;
}
}

Bind and use ISolidityCompiler optional

On Mac there is currently no implementation of ISolidityCompiler, thus the Guice config will fail:

1) No implementation for com.yakindu.solidity.compiler.builder.ISolidityCompiler was bound.
  at com.yakindu.solidity.compiler.SolidityCompilerModule.configure(SolidityCompilerModule.java:16)

Therefore the injection in SolidityBuilderParticipant must be optional and the registration as well.

[Build] Improve error indicators

For multi-line errors the highlighted area is to big.
E.g. errors/warnings that apply for functions should not highlight the entire block, but the function declaration instead.

Make Solidity version injectable

The solidity version is currently hard coded in the quick fix provider, which is a bad place. Better define a Guice binding in the runtime module and inject it there. Other places can make use of the same injection.

[Validation] 'pure' function

Add a validation that states if a function can be marked as 'pure'

Pure Functions
Functions can be declared pure in which case they promise not to read from or modify the state.

In addition to the list of state modifying statements explained above, the following are considered reading from the state:

Reading from state variables.
Accessing this.balance or

.balance.
Accessing any of the members of block, tx, msg (with the exception of msg.sig and msg.data).
Calling any function not marked pure.
Using inline assembly that contains certain opcodes.
pragma solidity ^0.4.16;

contract C {
function f(uint a, uint b) pure returns (uint) {
return a * (b + 42);
}
}

[Language] functions as parameters

The following example is valid code, that should result in a single compiler warning "Naming function type return parameters is deprecated.". We currently don't support functions as parameter

pragma solidity ^0.4.18;

contract test{
    function reduce(uint[] memory self, function (uint x, uint y) returns (uint) f) internal returns (uint r)
    {
        r = self[0];
        for (uint i = 1; i < self.length; i++) {
            r = f(r, self[i]);
        }
    }
  }

[Language] inheritance

Example:
`
contract TokenInterface {
string name;
}

contract Token is TokenInterface {
function Token (string _name) {
name= _name;
}
}
`
results in

Couldn't resolve reference to EObject 'name'

Disable Hyperlinks to build-in elements

Currently hyperlinks to build-in operations like assert are shown, but have no effect since there is no source for them to link to. Thus they should be disabled.

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.