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 Likes

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?

1 Like

Hi @basharatusman ,

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