Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tooltip and clickable links #712

Open
LucasSte opened this issue Mar 25, 2022 · 2 comments
Open

Improve tooltip and clickable links #712

LucasSte opened this issue Mar 25, 2022 · 2 comments
Labels
bounty-M enhancement New feature or request vscode-extension Visual Studio Code extension

Comments

@LucasSte
Copy link
Contributor

LucasSte commented Mar 25, 2022

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.
@gitcoinbot
Copy link

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
Copy link

gitcoinbot commented Apr 13, 2022

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.

@seanyoung seanyoung added enhancement New feature or request and removed bounty-awaiting-approval labels May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty-M enhancement New feature or request vscode-extension Visual Studio Code extension
Projects
None yet
Development

No branches or pull requests

3 participants