juanfranblanco / vscode-solidity

Visual Studio Code language support extension for Solidity smart contracts in Ethereum https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity
MIT License
892 stars 191 forks source link

add support to configure `evm_version` #444

Open zhiqiangxu opened 7 months ago

zhiqiangxu commented 7 months ago

Foundry can compile successfully but vscode is prompting: Undeclared identifier. Did you mean "blockhash"?(7576):

image

This error is the same error I get from foundry if evm_version is not configured here.

Currently there's no way to configure evm_version for a foundry project:

{
    "solidity.formatter": "forge",
    "solidity.defaultCompiler": "localNodeModule"
}

It would be great if vscode-solidity can read foundry.toml automatically.

Here's the repo that's trigering this issue:

https://github.com/zhiqiangxu/es-op-batchinbox

juanfranblanco commented 7 months ago

Added an option on settings now, yes importing from foundry.toml will be ideal

juanfranblanco commented 7 months ago

@zhiqiangxu it is out now

zhiqiangxu commented 7 months ago

@juanfranblanco It works great! Is there a plan to import from foundry.toml ?

juanfranblanco commented 7 months ago

Yes there is, as the settings import directly, hopefully I get some time to do it soon.