Feature request: allow multiple paths for `packageDefaultDependenciesDirectory`
See original GitHub issueI can currently set the location of “node_modules” like this:
# user settings
{
...
"solidity.packageDefaultDependenciesDirectory": "node_modules"
...
}
The structure of my repo looks like this:
- root
- packages
- package1
- contracts
- package2
- contracts
- package1
- packages
Since I’m using yarn workspaces, most of my third-party contracts are cached at the root. vscode-solidity has no trouble with those contracts.
However, sometimes I have to use the nohoist feature, which moves the contracts down below in “package1”, “package2”, etc. When that happens, I get this error:
Source "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol" not found; File import callback not supported
This could be solved by allowing multiple (glob) paths in the packageDefaultDependenciesDirectory
user setting. Example:
# user settings
{
...
"solidity.packageDefaultDependenciesDirectories": [
"node_modules",
"packages/package1/node_modules",
"packages/package2/node_modules"
]
...
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Trouble importing OpenZeppelin Contracts into VS Code
I fixed it. for some reason, it needed me to include the root path to the node_modules setting. Solidity: Package Default Dependencies Directory...
Read more >vscode-solidity/Lobby - Gitter
Hey @juanfranblanco , I submitted an issue for my feature request to add a combined .sol file for etherscan: juanfranblanco/vscode-solidity#44.
Read more >VS Code Extension for Solidity Smart Contracts in Ethereum
Solidity is the language used in Ethereum to create smart contracts, this extension provides: Syntax highlighting; Snippets; Compilation of the current ...
Read more >The Complete Tutorial On Getting Started With Smart ...
Go to https://nodejs.org/en/ and download the version for Latest Features on ... VS Code to your PATH, which allows launching VS Code from...
Read more >Collaborator Feature Requests - SmartBear Community
OIDC is much simpler to set up than SAML and having support for ... base name in different directories, or just want to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kerloom for this you can use remappings, Edit: this is what it is used by brownie Edit2: You can put your remappings in the settings also.
I think this might be a good idea not only for mono-repos. How would one go about and set up the dependencies folders for globally installed packages? In my case I have truffle installed globally while other packages like openzeppelin locally.