NomicFoundation / hardhat-vscode

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

No completion for inline contract member lookup #510

Open llllvvuu opened 1 year ago

llllvvuu commented 1 year ago

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?

https://github.com/NomicFoundation/hardhat-vscode/blob/6c7d5b68d6f53582cc8ed98dfd395578a7e58e64/server/src/services/completion/onCompletion.ts#L176-L178

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:

https://github.com/NomicFoundation/hardhat-vscode/assets/5601392/7cd0c1f0-8921-49f8-bb6b-224a3933b5ef

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

kanej commented 1 year ago

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

I think there are two issues to investigate here: