hardhat-vscode icon indicating copy to clipboard operation
hardhat-vscode copied to clipboard

feat(analyzer): add support for remappings.txt

Open fubhy opened this issue 3 years ago • 0 comments
trafficstars

Hi. Sorry for not opening an issue beforehand. I discussed this with @fvictorio on Discord a bit earlier today and thought I'd go ahead and experiment a bit.

This adds support for remappings.txt on a per-project basis. It looks for remappings.txt files beides hardhat config files.

This is probably not the ideal solution but there's no clear documentation from dapptools or foundry where these remappings files are supposed to be and how they are supposed to be interpreted (e.g. are they supposed to be next to a project config file like hardhat.config, foundry.toml, etc.)?

Generally, it seems like foundry is actually moving away from remappings.txt towards having those defined in the foundry.toml directly. In that case, the best solution might be to look for foundry.toml files and run the forge remappings commands to have them resolved by forge instead of attempting to do that ourselves.

fubhy avatar Aug 18 '22 13:08 fubhy