hardhat-vscode icon indicating copy to clipboard operation
hardhat-vscode copied to clipboard

Autocomplete triggers within comments

Open kanej opened this issue 3 years ago • 5 comments
trafficstars

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:

image

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.

kanej avatar Feb 08 '22 11:02 kanej

I think we want to add a check here as to whether we are in a comment. But this probably requires the slang parser.

kanej avatar Jan 02 '23 17:01 kanej

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.

fvictorio avatar Jan 02 '23 18:01 fvictorio

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?

kanej avatar Jan 02 '23 20:01 kanej

I wouldn't add it in to fix this bug, but this + documents on hover supports might be worth it as a stop gap.

kanej avatar Jan 02 '23 20:01 kanej

Will solidity-comments-extractor give 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?

fvictorio avatar Jan 03 '23 10:01 fvictorio