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
876 stars 188 forks source link

Source file requires different compiler version #285

Open tifrel opened 2 years ago

tifrel commented 2 years ago

By now I have tried a multitude of options and compiler versions, but the extension keeps complaining about a version mismatch, where it should not:

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;

contract Box {
  // irrelevant
}

Which yields following error message:

Source file requires different compiler version (current compiler is 0.8.6+commit.11564f7e.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version

My settings.json:

  "solidity.defaultCompiler": "localNodeModule",
  "solidity.compileUsingRemoteVersion": "v0.7.3+commit.9bfce1f6",
  "solidity.nodemodulespackage": "solc@0.7.3",

npm packages:

$ npm ls solc
hardhat-sandbox@ /<path>
└─┬ hardhat@2.6.4
  └── solc@0.7.3

Any ideas?

juanfranblanco commented 2 years ago

@tifrel please use the context menu to set the version of your workspace or global image