Open ghost opened 3 years ago
@eranralf you can simply do the following, it should not be a pain for you:
A setting could be put to enable this, as once all the versions are downloaded it may not affect much the switching. I was talking about it anyway.
Why a setting?
Introspecting might be an issue with your preferred version, also it will slow down things (download the version, load it in memory, compile on the fly, show errors).
Also we do also have different compilers now, for example the OVM one, hence you can easily switch between a local and remote version.
A setting could be put to enable this, as once all the versions are downloaded it may not affect much the switching. I was talking about it anyway.
I think this is a good idea, it is cumbersome to manually switch the compiler version every time I switch working files.
In hardhat I simply list the versions I need and then they're automatically selected. For instance my hardhat.config.ts contains
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.5.3",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
}
},
{
version: "0.6.12",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
}
},
{
version: "0.8.12",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
}
}
]
}
Something similar would be useful for vscode-solidity as well.
I am having a hard time getting a project with multiple solidity versions to work well with this extension. There should be better support for having contracts in the same workspace use different solc compilers.
Configuring the compiler version has always been a bit of a headache for this extension. I would prefer a fix which avoids the need to do any configuration.