Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Writing documentation with Gemini Code Assist in VSCode

Just started using Code Assist in VSCode. It seems to be working well for the most part. However, whenever I prompt it to write documentation for an open file, it explains the file instead of returning inline comments for sections of the code.

I've tried various prompts:

1) Write documentation for this file

2) Write inline documentation for this file

3) Re-write this code with documentation

4) Re-write the code and send me back a version I can copy

Any suggestions on how to best use Code Assist for writing documentation for existing code?

 

3 2 1,474
2 REPLIES 2

Please try something more specific, like "Write docstrings for all the functions and classes in this file and return me a copy". Typically it works fine. Maybe, you could send a more specific example with prompts that you tried, if that doesn't help?

Hi @basharatusman

Can you please add a bit more detail so that I would be able to help you out!