NomicFoundation / hardhat-vscode

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

FR: Custom Foundry installation location #535

Open beepidibop opened 6 months ago

beepidibop commented 6 months ago

My forge build is a bit messed up, the extension isn't picking up where my forge is even though where forge is working.

I see this was an issue here https://github.com/NomicFoundation/hardhat-vscode/issues/354 but I didn't install with cargo, so my default installation location didn't line up with https://github.com/NomicFoundation/hardhat-vscode/pull/366 or https://github.com/NomicFoundation/hardhat-vscode/pull/515.

Submitting this feature request since the template for the PR asks me to discuss it in issues before submitting a PR. I have a branch ready for the PR if this is approved.

oxcabe commented 6 months ago

I am also interested in this config feature, since Flatpak sandboxing is messing with the forge binary lookup:

Foundry project 'foundry-project' was not able to initialize correctly:
Error: Couldn't find forge binary. Performed lookup:
["forge","/home/oxcabe/.var/app/com.vscodium.codium/config/.foundry/bin/forge"]

If I were to request extra (or either implement it myself) for this feature, I'd ask for an additional "args" array config field to pass arguments to the forge binary. That way, it is not necessary to alter sandboxing permissions by calling /usr/bin/flatpak-spawn with forge as the positional argument.