hardhat-vscode
hardhat-vscode copied to clipboard
Refactor and improve handling of file URIs and filesystem paths
Several parts of the code make use of the helpers toUnixStyle and decodeUriAndRemoveFilePrefix. Newer code introduced the use of the vscode-uri which does a better job than the ad-hoc functions. Many bugs have appeared because of file paths/uris not being used or transformed consistently.
It would be ideal to replace the custom helpers and leverage vscode-uri. Also in the process, double check that state and logic are referencing paths and URIs appropiately and naming variables accordingly.
I just realized that in most places where it suits, the vscode-uri helpers are being used. But the ad-hoc helpers mentioned in the issue have some extra logic and are not directly replaceable, and I'm not sure of the implications it might have removing that extra logic. Probably it's been done that way because of how solc expects to receive the source inputs (e.g windows paths are transformed to unix-style paths). Also drive letters are lowercased on purpose. I'd leave this task for later, to avoid introducing potential bugs at the moment