Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Load solc version from project config files #463

Open
3esmit opened this issue Sep 13, 2024 · 1 comment
Open

[feature request] Load solc version from project config files #463

3esmit opened this issue Sep 13, 2024 · 1 comment

Comments

@3esmit
Copy link

3esmit commented Sep 13, 2024

There is no easy way of doing this... To make it even harder, this extension dont accept solc binary, must be solc-js.

In our projects we are having to update the solc version in two places, maybe even in 3 depending the framework.

I created a pre-commit hook just to keep in sync so I dont forget to change it on the extension settings.
It seems like it would be trivial to have a config in the extension that is the default, to use solc from project settings. Read files like foundry.toml, truffle.js, and others to set the solc version should be simple.

Foundry does not use solcjs, so it does not install solc in node_modules. It uses embedded svm.

3esmit added a commit to vacp2p/foundry-template that referenced this issue Sep 13, 2024
This commit adds a new pre-commit script called "pre-commit-solc-sync" to the githooks directory. The script is responsible for extracting the solc version from the "foundry.toml" file and updating the ".vscode/settings.json" file with the extracted version. If the "solidity.compileUsingRemoteVersion" key already exists in the settings file, the script updates the version. Otherwise, it modifies the last key, adds the new key, and closes the JSON object. Finally, the updated settings file is added to the commit.

The purpose of this change is to automate the synchronization of the solc version used for Solidity compilation in the project everywhere else its also need to be configured configured.

See juanfranblanco/vscode-solidity#463
@juanfranblanco
Copy link
Owner

Yes the issue is that there is not a real standard, now that some performance issues are solved, i will move to load the settings from any other toolset, or maybe adding yet another file that will be synced written from those. The plan is to start with foundry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants