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

[Bug] "textDocument/rename" renameSymbol does not handle invocation of functions with named parameters

DrakeEvans opened this issue · comments

When using named function parameters during a function invocation, like foo({ bar: 42, paz: 36}). Rename action does not properly handle these named parameters

Reproduction Repo: https://github.com/DrakeEvans/tools-for-solidity-bug/blob/master/src/Counter.sol
Steps:

Highlight newNumber on line 9, execute renameAction
newNumber on lines 8 & 11 will be renamed but newNumber on line 15 is not.

Ideally this would also update names in the natspec as well

Thanks for the reproduction repo.

This is likely that our usedef analysis is not taking into account named parameters in invocations.

That entire area is being rebuilt to leverage slang, our solidity compiler for developer tooling. But rename for named parameters in invocations might be a focused enough change to patch into the existing implementation.