NomicFoundation / hardhat-vscode

Solidity and Hardhat support for Visual Studio Code

Home Page:https://hardhat.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No completion for inline contract member lookup

llllvvuu opened this issue · comments

commented

To reproduce:

IERC20(tokenAddr). // no completion

IERC20 token = IERC20(tokenAddr);
token. // has completion

Completion looks like this:

Screenshot 2023-07-31 at 9 10 00 PM which I assume is the `getDefaultCompletions` branch?

} else {
result.items = getDefaultCompletions(documentAnalyzer, position);
}

Randomly tried in VSCode on solmate WETH:

Screenshot 2023-07-31 at 9 16 12 PM

Kind of interesting failure mode where this particular string works the first time but fails subsequent times:

Screen.Recording.2023-07-31.at.9.17.29.PM.mov

Also I think the function signature help is wrong because I didn't put the new keyword.

Thanks for the videos and details they really help to reproduce the issue.

I think there are two issues to investigate here:

  • What type and completion information are we tagging to inline usages of the contract
  • Why does the completion show different result at different times (as per the video)