beaugunderson / vscode-solidity-extended

✏ Solidity support for VSCode
https://marketplace.visualstudio.com/items?itemName=beaugunderson.solidity-extended
Other
10 stars 9 forks source link

Fixes cyclic import problems. #2

Closed MicahZoltu closed 7 years ago

MicahZoltu commented 7 years ago

solc uses the resolved file path as a lookup key to determine when it needs to load a file vs when it should use a previously loaded file. This means that if the user provides a relative path for the remapping, the key won't match the already loaded file and so it will load the file anew and run into a conflict.

solc also doesn't normalize path separators before using the path as a key, which means that the paths have to be strongly normalized before hand across everything. Since Windows works with both forward and backward slashes, its easiest to just use forward slash in this case (everything else appears to fall out naturally).

Strongly recommend testing on OSX/Linux before releasing if possible, as I have only tested this locally.

MicahZoltu commented 7 years ago

Let me know if you end up pushing this so I can update. In the meantime Running VSCode by proxy via debugging in another window... which is a bit inconvenient.

beaugunderson commented 7 years ago

thanks! published in 2.1.1