juanfranblanco / vscode-solidity

Visual Studio Code language support extension for Solidity smart contracts in Ethereum https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity
MIT License
902 stars 193 forks source link

dapphub libraries are not found, but compile fine #74

Closed nanexcool closed 6 years ago

nanexcool commented 6 years ago

Similar to #70

This is the tree for https://github.com/dapphub/ds-thing

tree -d
.
├── lib
│   ├── ds-auth
│   │   ├── lib
│   │   │   └── ds-test
│   │   │       └── src
│   │   └── src
│   ├── ds-math
│   │   ├── lib
│   │   │   └── ds-test
│   │   │       └── src
│   │   └── src
│   ├── ds-note
│   │   ├── lib
│   │   │   └── ds-test
│   │   │       └── src
│   │   └── src
│   └── ds-test
│       └── src
├── out
└── src

It looks like it'd be correct for finding the files. For example under src/thing.sol there are three imports:

import 'ds-auth/auth.sol';
import 'ds-note/note.sol';
import 'ds-math/math.sol';

These libraires are under lib/ds-auth/src/auth.sol etc...

juanfranblanco commented 6 years ago

@nanexcool you will need to add the path for "lib" in the dependencies module and the contracts in "src". The original library was dappsys and that was the basis, so it has to work :)

I will post a sample ASAP of the settings.

juanfranblanco commented 6 years ago

"solidity.packageDefaultDependenciesContractsDirectory": "src", "solidity.packageDefaultDependenciesDirectory": "lib",

image

juanfranblanco commented 6 years ago

And the compilation using vscode

image

nanexcool commented 6 years ago

Thank you very much, that worked! I got confused because in the description I saw:

"Libraries will have the same name as their folder they are included. Solidity files will be in the 'src' folder. Libraries will be included in the 'lib' folder."

Thanks again!