NomicFoundation / hardhat-vscode

Solidity and Hardhat support for Visual Studio Code
https://hardhat.org
MIT License
174 stars 44 forks source link

Signature help not working properly #330

Open antico5 opened 1 year ago

antico5 commented 1 year ago

This might have to do with the change of making analysis async.

Simple example:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
contract Foo {
   function hi(uint a) public pure {
   }
}

contract Small {
   Foo foo;
   constructor(){
      foo.hi(<CURSOR>
   }
}

Hint: when there's a semicolon at the end of the line, the signature help works

antico5 commented 1 year ago

Just noticed this might be a duplicate of #174

antico5 commented 1 year ago

I did some investigation on this and here's what I could find:

I think these are the required changes to have this feature working properly:

kanej commented 1 year ago

Invoking analysis and making the onSignatureHelp async both sound like good moves.

I suspect we will want to hold on this until we can pull in slang parser to give us better parse results in the case of syntax errors.