Closed FreezyEx closed 2 years ago
Thanks for the feedback. First can I confirm what OS your running on?
I suspect the issue is that there is no closing "
in the example above. We determine whether we are in an import statement by parsing the line. But our parser can misreport if there is no closing bracket:
@FreezyEx can you confirm you can completions if you start with import "<cursor here>";
?
This is a limitation, but improvements mean rework in solidity-parser, making this quite a big task.
I just tried adding the closing"
but same issue:
I am on Windows10
@FreezyEx can I confirm two things:
@openz
and you hit ctrl + space
, or if you type @openzeppelin
then /
do you get any completion?"@openzeppelin/contracts/access/Ownable.sol"
in the import bellow if you right click on Ownable.sol
and choose go to definition?
- the completion requires a trigger, it doesn't happen on every character. So if the cursor is after z in @openz and you hit ctrl + space, or if you type @openzeppelin then / do you get any completion?
No, I don't get any completion.
- are you able to navigate to openzepplin files, for instance the
"@openzeppelin/contracts/access/Ownable.sol"
in the import bellow if you right click onOwnable.sol
and choose go to definition?
Yes it correctly goes to the Ownable.sol
Are there any errors in the output channel immediately after attempting an import completion on the line in question. You can find the output channel by going to the output tab and picking hardhat from the dropdown:
I just tried with another project and now seems to work. I don't understand which was the issue. Both are hardhat projects.
Now I have the autocompoletion after openzeppelin/
UPDATE: I must restart vscode after intalling a package and get the autocompletion.
@FreezyEx that is a known bug, https://github.com/NomicFoundation/hardhat-vscode/issues/91#issue-1161216370.
Sorry it took so many iterations to get there, I will lead with that next time. Thanks for helping work that through.
Thank you for the help @kanej
Autocompletion as shown here is not working
https://twitter.com/i/status/1501981617304309760