Open markokhman opened 2 years ago
I realised that it is working this way because ERC721.sol is in one of node_modules. Once i put my contract file into the openzeppelin module folder, next to the ERC721.sol - autocompletion works fine. But isn't that possible to make it so that I could use autocompletion for modules that are imported?
Hi @markokhman in settings you can set the value of the dependencies forlder, that is the defaulted to node_modules as many contracts are distributed using npm, you can change the folder if you want (relative to the root of the project)
We have support also for the "remappings" file, check the readme for instructions on that (and the above) to get bigger detail.
https://github.com/juanfranblanco/vscode-solidity#project-structure-and-remappings
@juanfranblanco thank you very much for getting into this issue for me! Really appreciate that.
I was able to successfully import a contract (ex. ERC271) that is provided by @openzeppelin and stored in node_modules, so I guess this means that my VSCode is configured properly. Also i get autocompletion if i reference directly from contract:
I face an issue if I try to access the methods of this imported contract directly:
I was able to find out that if I put my custom contract next to the ERC721.sol - then the autocomplete magically works!
But isn't it supposed to work the same way once I import the ERC721 from the @openzeppelin?
Seems ok here:
if the parser fails, try this.
, i think i have parsing issues on the return value with anonymous fields.
The issue was with vscode, as there was not possible to set the label (null) the autocomplete was breaking, this was not related to the parser.
Hi @juanfranblanco thanks for your awesome plugin.
If I may there is still a small issue in 0.0.137, not sure if this is helping but it's quite confusing. When the contract can not be parsed I guess with a syntax error (not all though...), completion goes away. Not sure if this is normal behavior or expected.
Cheers !
Hello folks! I'm struggling severely to configure my Vscode working properly.
I have imported contract of openzeppelin - ERC721.sol Now I expected its function setApprovalForAll() be available in intellisense when i start typing it in my contract, but here is what i see if I start typing it and then click Ctrl+Space:
In the same time if i explicitly type the contract name - then i can see intellisense autocompletion:
Please give me a hint - what am I doing wrong?