hardhat-vscode
hardhat-vscode copied to clipboard
Autocomplete triggers within comments
This is feedback from @fvictorio's notes.
We trigger auto completes on on the . key. This is currently working inside of comments which is a pain if you use a fullstop:

We configure completions for the . key, our ideal would be not to attempt completion in a comment rather than an empty list, though that is clearly better than suggesting the generic keyword options.
Some exploration of how other language extensions deal with this is probably the best place to start.
I think we want to add a check here as to whether we are in a comment. But this probably requires the slang parser.
Couldn't you use solidity-comments-extractor and then check if the cursor is within a comment? Prettier Solidity uses that under the hood, so it's battle tested.
Alternatively, we could modify solidity-analyzer to return information about comments too.
Will solidity-comments-extractor give us the ranges of every comment in the file?
Could we do the extract as part of analysis and keep the ranges for instance?
I wouldn't add it in to fix this bug, but this + documents on hover supports might be worth it as a stop gap.
Will
solidity-comments-extractorgive us the ranges of every comment in the file?
Yes
Could we do the extract as part of analysis and keep the ranges for instance?
Also yes?