-
Notifications
You must be signed in to change notification settings - Fork 47
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
Does not work with the "src/=src/" remappings #369
Comments
Thanks for the report @PaulRBerg. I have been able to reproduce locally. It looks like we are running the wrong solc version in this case for the diagnostics. We will have to investigate how that is happening. |
@PaulRBerg I found the issue, there's one line in the remappings.txt file that's making the extension misbehave in unsuspected ways, and it's the Our current handling of remappings makes it so the solc input has the After removing the |
Thanks a lot for digging this, @antico5. Removing So it looks like users have to choose between some VSCode features and Hardhat when importing directly from |
@PaulRBerg Just did a little testing and our extension can deal with "go to definition" requests through Althought a small caveat, jump to definition doesn't work if the definition is present on a file that we cannot parse, and we use In any case, I don't see why we'd need to have the |
Oh, I think you're right. I was using Juan Blanco's extension when I added I'll try it out and follow up here to report my findings. |
Unfortunately, removing Also, Forge is not able to compile the code without the
I have tried to change |
Wait, on second thoughts, I now realize that the issue above was caused by PRBMath itself having a So the issue is that if just of a user's dependencies have this remapping, then the user itself is forced to add it, to disambiguate the Therefore, I think that a remedy to this is sort of needed, because users can't control what remappings get set by third-parties. |
@PaulRBerg thanks for giving us more information on this. I'll try now to change the way remappings are built when sent to solc, to use relative paths instead of absolute, to allow having the About your second-to-last comment, where you show the import error, to me it seems that it's just a legitimate import error, since relative imports shouldn't fail as they are not affected by remappings (at least on the extension side). I may be missing something so if it's the case please help me reproduce with a minimum example. |
Hi Everyone. Not sure how much is this relevant but I'm running in issue described here:
Compiles fine, but VScode underlines with red this import saying:
Apperently it tries to look in Right now will try to roll back extension version and see if this helps. Please let me know if there is any way to fix this. Thx! Upd: Downgrade to |
@peersky by any chance are you working on a public project that we can check? otherwise please let us know if you are using hardhat, foundry, or both? in the past we've found this issue one projects using hardhat+foundry with the |
Description
The
using for ... global
directive is explained in the release announcement for Solidity v0.8.13, and my particular situation is explained here.I have a bunch of imports like this:
Which I am trying to apply to the
UD60x18
value type, like this:The Hardhat VSCode extension complains:
But I can happily compile my contracts with
forge build
.Source Code
See the
src/ud60x18/ValueType.sol
file in PRBMath.The text was updated successfully, but these errors were encountered: