Open ejolanix opened 3 years ago
@ejolanix very good points, there are many discussions about having a generic project file which will allow to "sync" at project level the current compiler version, so even if different tools use them internally the right version is used across, in the same way this project file will have the mappings for the libraries, etc. Now adding support to all tools and reading their current configured version, whilst a fast solution, it may lead to problems in the future.
Now, when everything is in sync, like you said ide compiler, tooling etc.. configuring an external command to compile could be added for sure.
Adding to that, which is an issue with pointing to another compiler, compilation output should also be an standard tools seem to change the output (mainly not outputting the complete solc compilation output, or not providing it at all), so it is hard to plugin stuff to read from the compilation. The ideal workflow will be to all the compilation output will be always in a predefined place and actually use the ide for that, then in the project file (or settings), you could add the tasks to run afterwards.
Is it possible to delegate the compile commands (i.e. ideally both "Solidity: Compile All" or "Solidity: Compile Contract") to a script or similar invoking
npx hardhat compile
when using the Visual Studio Code Solidity extension in a WSL remote?Otherwise if not could the configuration setting
solidity.compileUsingRemoteVersion
instead be returned by a script using another Solidity extension option (e.g.solidity.compileUsingScriptDefinedRemoteVersion
, which could be implemented to read the version from Hardhat's config file, or any other for that matter (such as Truffle's etc.)?The ultimate objective is to avoid manual version duplication and thus ensure that there are no accidental version mismatches between the compiler version used by the Solidity extension's compile commands and version being used by Hardhat (or any other build system such as Truffle for that matter).
While I'm new to JS & Hardhat as an alternative I imagine it wouldn't be too hard to implement a version sync/reconciliation script from within Hardhat. Has anybody else implemented this alternative already?