solang icon indicating copy to clipboard operation
solang copied to clipboard

Improve tooltip and clickable links

Open LucasSte opened this issue 3 years ago • 2 comments

Raison D’être

The Solang compiler has a VSCode extension that allows developers to visualize errors and warnings directly on the editor. This extension works, but needs many improvements to become more useful for everyone.

What needs to be done?

Some things are missing from the current VSCode extension. The tooltip does not support function definitions and inline assembly. In addition, we would like to see some improvements to the existing implementation. The tooltip should contain a clickable link to go to references for every supported type and the description of the tip should be rewritten.

Given this solidity:

contract c {
	struct S {
	   int[2] f1;
	   X f2;
	}

	struct X {
	   bool g1;
	}

     function f(S s) public returns (bool) {
         return s.f2.g1;
     }
     
     function g() public {
         bool b = f(S({f1: [1,2]: f2: X(true)}));
     }
}

Then a tooltip/hover over the function argument s (both occurrences) should give you:

struct C::S {
   int[2] f1;
   X f2;
}
---
Go to C::S

The C::S should be a link which sends the cursor to the definition. Hovering over X within this tooltip should produce another tooltip for C::X with a similar content. When hovering over f2 or g1 in s.f2.g1 the definition of f2 or g1 should be given.

When hovering over f (both occurrences) there should be a tooltip like so:

function C::f(S s) public returns (bool)
---
Go to C::f

Within this tool tip, hovering over S should do the same.

Hovering over warnings, informationals, and errors should give a tooltip with their message. All other variables and types, such events, contracts, internal functions, external functions, storage variables, variables, constant variables and enums, should have a similar tooltip, listing their fields with a link to the type definition. Any doc comments for a type should also be given in a tooltip. For constants, their constant value should be displayed.

What should be a complete project?

  • Support function definition in the VSCode extension.
  • Support inline assembly in the VSCode extension.
  • Add clickable links to the tooltip and fields for all types and variables
  • Improve the description of the tooltip modal.

How will the PR be evaluated?

  1. We would like to see a single PR containing all the milestones.
  2. The PR must have vscode tests (by extending existing tests). We want to make sure the implementation works.
  3. Include in your PR screenshots of the new functionalities.

LucasSte avatar Mar 25 '22 10:03 LucasSte

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 400.0 DAI (400.0 USD @ $1.0/DAI) attached to it.

gitcoinbot avatar Apr 13 '22 12:04 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 264 years, 5 months from now. Please review their action plans below:

1) vividwood has applied to start work (Funders only: approve worker | reject worker).

Hi, I have experience in developing VS Code extensions and will be glad to work on this bounty! 2) tezloves4 has applied to start work (Funders only: approve worker | reject worker).

I will create Support for function definition in the VSCode extension. Support for inline assembly in the VSCode extension. Add clickable links to the tooltip and fields for all types and variables Improve the description of the tooltip modal. 3) bshevchenko has applied to start work (Funders only: approve worker | reject worker).

Ready to start with this one 🙏💜 4) njinfrili has applied to start work (Funders only: approve worker | reject worker).

1st I'd check the code all the way down to the bottom. After that I will have in mind what the code is missing and give my best to edit/fix it.

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Apr 13 '22 14:04 gitcoinbot